Class AdapterTransferLease

Namespace
MirrorPulse.Adapter.Sdk
Assembly
MirrorPulse.Adapter.Sdk.dll

Owns a temporary transfer file that is deleted when its stream closes.

public sealed class AdapterTransferLease : IAsyncDisposable
Inheritance
AdapterTransferLease
Implements
Inherited Members

Remarks

Create the lease inside the transfer-cache directory granted by the Host. Dispose it on success, failure and session shutdown. After a cancellation, await cleanup before sending the acknowledgement.

Constructors

AdapterTransferLease(string)

public AdapterTransferLease(string transferCacheDirectory)

Parameters

transferCacheDirectory string

Properties

CancellationToken

The token signaled when CancelAsync() is called.

public CancellationToken CancellationToken { get; }

Property Value

CancellationToken

Path

public string Path { get; }

Property Value

string

Stream

The exclusive, readable and writable stream for the staged transfer.

public FileStream Stream { get; }

Property Value

FileStream

Methods

CancelAsync()

Signals receiving work and disposes the staged transfer.

public ValueTask CancelAsync()

Returns

ValueTask

Remarks

An accepted backend mutation has its own recovery contract.

DisposeAsync()

public ValueTask DisposeAsync()

Returns

ValueTask