# Class InMemoryLockProvider

Namespace
  adas_core.Application.Services.Caching

Assembly
  adas-core.Application.dll

Implementación local del sistema de locking por clave. Se basa en SemaphoreSlim y solo controla concurrencia DENTRO del proceso. Para CacheService (in-memory).

    public class InMemoryLockProvider : ILockProvider

Inheritance
  object
  InMemoryLockProvider

Implements
  ILockProvider

Inherited Members
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## Methods

### AcquireAsync(string, TimeSpan)

Intenta adquirir el lock por clave.

    public Task<bool> AcquireAsync(string key, TimeSpan timeout)

#### Parameters

`key` string
`timeout` TimeSpan

#### Returns

Task<bool>

### ReleaseAsync(string)

Libera el lock (si existe y no está ya liberado).

    public Task ReleaseAsync(string key)

#### Parameters

`key` string

#### Returns

Task