Commanded.Middleware.Uniqueness (Commanded Uniqueness Middleware v0.7.1) View Source

Documentation for Commanded.Middleware.Uniqueness.

Link to this section Summary

Functions

Claims a key, value, owner, partition set or reports that this combination has already been claimed.

Claims a key, value, partition set or reports that this combination has already been claimed.

Returns default parition which is by default @Commanded.Middleware.Uniqueness

Releases a value record via key, value, owner, partition set

Releases a value record via key, owner, partition set

Releases a value record via key, value, partition set

Link to this section Functions

Link to this function

claim(key, value, owner, partition \\ Commanded.Middleware.Uniqueness)

View Source

Specs

claim(key :: term(), value :: term(), owner :: term(), partition :: term()) ::
  :ok
  | {:error, :already_exists}
  | {:error, :unknown_error}
  | {:error, :no_adapter}

Claims a key, value, owner, partition set or reports that this combination has already been claimed.

If a key, value, owner, partition set has to be claimed and an old value for the given owner exists it releases first.

If partition is ommited then default partition used.

Link to this function

claim_without_owner(key, value, partition \\ Commanded.Middleware.Uniqueness)

View Source

Specs

claim_without_owner(key :: term(), value :: term(), partition :: term()) ::
  :ok
  | {:error, :already_exists}
  | {:error, :unknown_error}
  | {:error, :no_adapter}

Claims a key, value, partition set or reports that this combination has already been claimed.

If partition is ommited then default partition used.

Returns default parition which is by default @Commanded.Middleware.Uniqueness

Link to this function

release(key, value, owner, partition \\ Commanded.Middleware.Uniqueness)

View Source

Specs

release(key :: term(), value :: term(), owner :: term(), partition :: term()) ::
  :ok
  | {:error, :claimed_by_another_owner}
  | {:error, :unknown_error}
  | {:error, :no_adapter}

Releases a value record via key, value, owner, partition set

Link to this function

release_by_owner(key, owner, partition \\ Commanded.Middleware.Uniqueness)

View Source

Specs

release_by_owner(key :: term(), owner :: term(), partition :: term()) ::
  :ok | {:error, :unknown_error} | {:error, :no_adapter}

Releases a value record via key, owner, partition set

Link to this function

release_by_value(key, value, partition \\ Commanded.Middleware.Uniqueness)

View Source

Specs

release_by_value(key :: term(), value :: term(), partition :: term()) ::
  :ok | {:error, :unknown_error} | {:error, :no_adapter}

Releases a value record via key, value, partition set