View Source wpool_process_callbacks behaviour (worker_pool v6.2.0)

Link to this section Summary

Functions

Sends a notification to all registered callback modules.

Link to this section Types

-type event() :: handle_init_start | handle_worker_creation | handle_worker_death.
-type state() :: module().

Link to this section Callbacks

Link to this callback

handle_init_start/1

View Source (optional)
-callback handle_init_start(wpool:name()) -> any().
Link to this callback

handle_worker_creation/1

View Source (optional)
-callback handle_worker_creation(wpool:name()) -> any().
Link to this callback

handle_worker_death/2

View Source (optional)
-callback handle_worker_death(wpool:name(), term()) -> any().

Link to this section Functions

Link to this function

add_callback_module(EventManager, Module)

View Source
-spec add_callback_module(wpool:name(), module()) -> ok | {error, any()}.
Adds a callback module.
-spec notify(event(), #{event_manager := any(), _ => _}, [any()]) -> ok.
Sends a notification to all registered callback modules.
Link to this function

remove_callback_module(EventManager, Module)

View Source
-spec remove_callback_module(wpool:name(), module()) -> ok | {error, any()}.
Removes a callback module.