View Source erldist_filter_handler behaviour (erldist_filter v1.28.5)

Summary

Types

-type action() :: drop | keep.
Link to this type

control_with_payload()

View Source
-type control_with_payload() :: udist:dop_with_payload_t().
Link to this type

control_without_payload()

View Source
-type control_without_payload() :: udist:dop_without_payload_t().
-type data() ::
    #data{router_number :: erldist_filter_router:router_number(),
          sysname :: node(),
          last_seen :: integer()}.
-type decision() ::
    {action(), control_without_payload()} | {action(), control_with_payload(), payload()}.
-type decision_result() :: action() | decision().
Link to this type

gen_statem_event_content()

View Source
-type gen_statem_event_content() :: dynamic().
-type hint() :: drop | safe | unsafe.
-type init_data() ::
    #init_data{router_number :: erldist_filter_router:router_number(), sysname :: node()}.
-type payload() :: dynamic().
-type stop_reason() :: normal | shutdown | {shutdown, term()} | term() | dynamic().

Callbacks

Link to this callback

classify(Handler, Sysname, Control)

View Source
-callback classify(Hint :: hint(), Sysname :: node(), Control :: control_without_payload()) ->
            decision_result().
Link to this callback

classify(Handler, Sysname, Control, Payload)

View Source
-callback classify(Hint :: hint(),
         Sysname :: node(),
         Control :: control_with_payload(),
         Payload :: payload()) ->
            decision_result().
Link to this callback

spawn_request_init(Sysname, Module, FunctionName, Arguments)

View Source
-callback spawn_request_init(Sysname :: node(),
                   Module :: module(),
                   FunctionName :: atom(),
                   Arguments :: [payload()]) ->
                      dynamic().

Functions

-spec callback_mode() -> gen_statem:callback_mode_result().
Link to this function

child_spec(RouterNumber)

View Source
-spec child_spec(RouterNumber) -> supervisor:child_spec()
              when RouterNumber :: erldist_filter_router:router_number().
Link to this function

handle(EventType, EventContent, Data)

View Source
-spec handle(EventType, EventContent, Data) -> HandleEventResult
          when
              EventType :: gen_statem:event_type(),
              EventContent :: gen_statem_event_content(),
              State :: handle,
              Data :: data(),
              HandleEventResult :: gen_statem:event_handler_result(State, Data).
-spec init(InitData) -> InitResult
        when
            InitData :: init_data(),
            State :: handle,
            Data :: data(),
            InitResult :: gen_statem:init_result(State, Data).
Link to this function

start_link(RouterNumber, Sysname)

View Source
-spec start_link(RouterNumber, Sysname) -> gen_statem:start_ret()
              when RouterNumber :: erldist_filter_router:router_number(), Sysname :: node().
Link to this function

terminate(Reason, State, Data)

View Source
-spec terminate(Reason, State, Data) -> Ignored
             when Reason :: stop_reason(), State :: handle, Data :: data(), Ignored :: term().