View Source cets_dist_blocker (cets v0.2.0)

Disallow distributed erlang connections until cleaning is done.

This module prevents a node from reconnecting, until cleaning activity is finished. It prevents race conditions.

This module assumes all nodes share the same cookie.

Link to this section Summary

Link to this section Types

-type cleaner_pid() :: pid().
-type state() :: #{cleaners := [cleaner_pid()], waiting := waiting()}.
-type waiting() :: [{node(), cleaner_pid()}].

Link to this section Functions

-spec add_cleaner(pid()) -> ok.
Register CleanerPid as a cleaner.
Link to this function

cleaning_done(CleanerPid, Node)

View Source
-spec cleaning_done(pid(), node()) -> ok.

Confirm that cleaning is done.

This function should be called by a cleaner when it receives nodedown and finishes cleaning.
Link to this function

code_change(OldVsn, State, Extra)

View Source
Link to this function

handle_call(Request, From, State)

View Source
Link to this function

handle_info(Info, State)

View Source
Spawn dist_blocker
Link to this function

terminate(Reason, State)

View Source