Beethoven.Ready (Beethoven v0.3.9)
Simple PID to track when Beethoven has fully initialized. Usually just called from RoleServer when it has ran out of work.
This is important as creating Mnesia tables before joining Beethoven will cause cluster conflicts.
Public API
- 'ready?/0' Queries the ETS table used by this module to see if Beethoven is ready. Returns boolean.
- 'until_ready/1' Similar to
ready?/0
but will block until Beethoven is ready. set_ready/1
Sets the ready state of Beethoven on ETS. Normally called byBeethoven.RoleServer
Summary
Functions
Returns a specification to start this module under a supervisor.
Gets the current ready state for Beethoven.
Sets ready state for Beethoven. Setting this value to true will make ready?()
return true; indicating the service has initialized.
Setting false
performs the opposite.
Supervisor Entry point.
Similar to ready?()
but will block until the service is ready.
Defaults to 5_000 milliseconds.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec ready?() :: boolean()
Gets the current ready state for Beethoven.
@spec set_ready(boolean()) :: :ok
Sets ready state for Beethoven. Setting this value to true will make ready?()
return true; indicating the service has initialized.
Setting false
performs the opposite.
@spec start_link(any()) :: GenServer.on_start()
Supervisor Entry point.
@spec until_ready(integer()) :: :ok | :timeout
Similar to ready?()
but will block until the service is ready.
Defaults to 5_000 milliseconds.