Skip to content

LangfuseInProcessResourceLockProvider

NexusLabs.Foundry.Langfuse

LangfuseInProcessResourceLockProvider Class

Coordinates Langfuse resource creation within one process.

public sealed class LangfuseInProcessResourceLockProvider : NexusLabs.Foundry.Langfuse.ILangfuseResourceLockProvider

Inheritance System.Object 🡒 LangfuseInProcessResourceLockProvider

Implements ILangfuseResourceLockProvider

Remarks

Use a distributed ILangfuseResourceLockProvider when multiple application processes can initialize the same Langfuse project concurrently.

Constructors

LangfuseInProcessResourceLockProvider() Constructor

Initializes an empty in-process resource lock provider.

public LangfuseInProcessResourceLockProvider();

Methods

LangfuseInProcessResourceLockProvider.AcquireAsync(LangfuseResourceLockKey) Method

Acquires exclusive ownership of a resource key without caller cancellation.

public System.Threading.Tasks.ValueTask<System.IAsyncDisposable> AcquireAsync(NexusLabs.Foundry.Langfuse.LangfuseResourceLockKey key);

Parameters

key LangfuseResourceLockKey

The stable opaque key supplied by Foundry.

Implements AcquireAsync(LangfuseResourceLockKey)

Returns

System.Threading.Tasks.ValueTask<System.IAsyncDisposable>
An asynchronous lease whose disposal releases ownership.

LangfuseInProcessResourceLockProvider.AcquireAsync(LangfuseResourceLockKey, CancellationToken) Method

Acquires exclusive ownership of a resource key.

public System.Threading.Tasks.ValueTask<System.IAsyncDisposable> AcquireAsync(NexusLabs.Foundry.Langfuse.LangfuseResourceLockKey key, System.Threading.CancellationToken cancellationToken);

Parameters

key LangfuseResourceLockKey

The stable opaque key supplied by Foundry.

cancellationToken System.Threading.CancellationToken

A token that can cancel the wait before ownership is acquired.

Implements AcquireAsync(LangfuseResourceLockKey, CancellationToken)

Returns

System.Threading.Tasks.ValueTask<System.IAsyncDisposable>
An asynchronous lease whose disposal releases ownership.

Exceptions

System.OperationCanceledException
cancellationToken was canceled before ownership was acquired.