Table of Contents

Interface IAppMutexService

Namespace
Phoesion.Glow.SDK.Firefly
Assembly
Phoesion.Glow.SDK.Firefly.Abstractions.dll

Build-in distributed mutex.

public interface IAppMutexService

Methods

LockAsync(string, GlowAppScope)

Acquires ownership of the mutex specified.

ValueTask<IAppMutexService.IAppMutexHandler> LockAsync(string mutexName, GlowAppScope scope = GlowAppScope.Service)

Parameters

mutexName string

The mutex name

scope GlowAppScope

The scope of the mutex.

  • QuantumSpace scope means the mutex is shared with other services in the same QuantumSpace.
  • Service scope means this mutex is only visible to other instances of the same service.

Returns

ValueTask<IAppMutexService.IAppMutexHandler>

LockAsync(string, CancellationToken, GlowAppScope)

Acquires ownership of the mutex specified.

ValueTask<IAppMutexService.IAppMutexHandler> LockAsync(string mutexName, CancellationToken cancellationToken, GlowAppScope scope = GlowAppScope.Service)

Parameters

mutexName string

The mutex name

cancellationToken CancellationToken

Request mutex lock cancellation

scope GlowAppScope

The scope of the mutex.

  • QuantumSpace scope means the mutex is shared with other services in the same QuantumSpace.
  • Service scope means this mutex is only visible to other instances of the same service.

Returns

ValueTask<IAppMutexService.IAppMutexHandler>