Raxol.Core.Runtime.Plugins.TimerManager.Behaviour behaviour (Raxol v0.4.0)

View Source

Defines the behaviour for plugin timer management.

This behaviour is responsible for:

  • Managing plugin timers
  • Handling timer scheduling and cancellation
  • Coordinating timer events
  • Managing timer state

Summary

Callbacks

Cancels an existing timer and returns updated state.

Gets the current timer state.

Handles timer message delivery.

Schedules a new timer and returns updated state.

Updates the timer state.

Callbacks

cancel_existing_timer(state)

@callback cancel_existing_timer(state :: map()) :: map()

Cancels an existing timer and returns updated state.

get_timer_state(state)

@callback get_timer_state(state :: map()) :: map()

Gets the current timer state.

handle_timer_message(state, message)

@callback handle_timer_message(
  state :: map(),
  message :: term()
) :: map()

Handles timer message delivery.

schedule_timer(state, message, timeout)

@callback schedule_timer(
  state :: map(),
  message :: term(),
  timeout :: non_neg_integer()
) :: map()

Schedules a new timer and returns updated state.

update_timer_state(state, new_state)

@callback update_timer_state(
  state :: map(),
  new_state :: map()
) :: map()

Updates the timer state.