Table of Contents

Class ResourceRequestHandle

Namespace
Maplibre.NativeFfi.Resource
Assembly
Maplibre.NativeFfi.dll

Resource provider request handle.

public sealed class ResourceRequestHandle : IDisposable
Inheritance
ResourceRequestHandle
Implements
Inherited Members

Properties

IsClosed

Whether the request handle has been completed or released.

public bool IsClosed { get; }

Property Value

bool

Methods

Close()

Releases the native request handle without completing it.

public void Close()

Complete(ResourceResponse)

Completes the native request. Successful completion closes this wrapper.

public void Complete(ResourceResponse response)

Parameters

response ResourceResponse

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~ResourceRequestHandle()

protected ~ResourceRequestHandle()

IsCancelled()

Whether the native request has been cancelled.

public bool IsCancelled()

Returns

bool

SetCancelCallback(Action)

Registers a callback that runs once when MapLibre cancels this request.

public void SetCancelCallback(Action callback)

Parameters

callback Action

Remarks

The callback runs on the thread that discards the request: the runtime owner thread inside a map or runtime call, and a MapLibre thread otherwise. It runs only for a request the provider has not completed, and it may complete or close this handle. When the request is already cancelled, the callback runs on the calling thread before this method returns, as part of this call: a concurrent Close() on another thread does not wait for it. A request accepts one registration, and a second registration throws InvalidStateException.