Zero Install .NET API  2.18.1
ZeroInstall.Store.Implementations.FetchHandle Class Reference

Provides a way to share an Implementation fetch callback as per-thread ambient state. More...

Static Public Member Functions

static IDisposable Register (Func< Implementation, string > callback)
 Registers an Implementation fetch callback for the current thread. More...
 
static string Use (Implementation implementation)
 Downloads an Implementation to a local cache if missing and returns its path. Register must be called first on the same thread. More...
 

Detailed Description

Provides a way to share an Implementation fetch callback as per-thread ambient state.

This is useful for making the high-level Fetcher service available to low-level systems such as a Recipe step.

Member Function Documentation

◆ Register()

static IDisposable ZeroInstall.Store.Implementations.FetchHandle.Register ( Func< Implementation, string >  callback)
inlinestatic

Registers an Implementation fetch callback for the current thread.

Parameters
callbackA callback that downloads an implementation to a local cache if missing and returns its path.
Returns
A handle that can be used to remove the registration.

◆ Use()

static string ZeroInstall.Store.Implementations.FetchHandle.Use ( Implementation  implementation)
inlinestatic

Downloads an Implementation to a local cache if missing and returns its path. Register must be called first on the same thread.

Parameters
implementationThe implementation to be downloaded.
Returns
A fully qualified path to the directory containing the implementation.
Exceptions
InvalidOperationExceptionRegister was not called first.

The documentation for this class was generated from the following file: