Skip to content

ILangfuseResourceLockProvider

NexusLabs.Foundry.Langfuse

ILangfuseResourceLockProvider Interface

Coordinates project-resource creation across Langfuse client instances.

public interface ILangfuseResourceLockProvider

Derived
LangfuseInProcessResourceLockProvider

Remarks

Score-config and custom-model creation do not provide a provider-side idempotency key. Hosted applications that initialize those resources from multiple processes should register a distributed implementation before calling AddFoundryLangfuse(this IServiceCollection, Action<LangfuseOptions>). Standalone applications can assign an implementation to ResourceLockProvider.

Methods

ILangfuseResourceLockProvider.AcquireAsync(LangfuseResourceLockKey) Method

Acquires exclusive ownership of a resource key without caller cancellation.

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

Parameters

key LangfuseResourceLockKey

The stable opaque key supplied by Foundry.

Returns

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

ILangfuseResourceLockProvider.AcquireAsync(LangfuseResourceLockKey, CancellationToken) Method

Acquires exclusive ownership of a resource key.

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.

Returns

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

Exceptions

System.OperationCanceledException
cancellationToken was canceled before ownership was acquired.