Concur.Semaphore (concur v0.2.0) View Source

Simple GenServer-based semaphores implementation, with the full semaphore functions P (wait) and V (signal).

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Asynchronously increment the value of the semaphore by 1.

Stops the semaphore process.

Synchronously wait for the semaphore to be available. Decrement the semaphore by 1 once it is.

Link to this section Types

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

new(limit()) :: t()

Specs

signal(t()) :: :ok

Asynchronously increment the value of the semaphore by 1.

Specs

stop(t()) :: :ok

Stops the semaphore process.

Specs

wait(t()) :: :ok

Synchronously wait for the semaphore to be available. Decrement the semaphore by 1 once it is.