View Source wpool_process_callbacks behaviour (worker_pool v6.4.0)

Summary

Functions

Sends a notification to all registered callback modules.

Types

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

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().

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.