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 by Beethoven.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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

ready?()

@spec ready?() :: boolean()

Gets the current ready state for Beethoven.

set_ready(ready_state)

@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.

start_link(init_args \\ [])

@spec start_link(any()) :: GenServer.on_start()

Supervisor Entry point.

until_ready(timeout \\ 5000)

@spec until_ready(integer()) :: :ok | :timeout

Similar to ready?() but will block until the service is ready. Defaults to 5_000 milliseconds.