View Source erldist_filter_handler behaviour (erldist_filter v1.1.0)

Link to this section Summary

Link to this section Types

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

control_with_payload/0

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

control_without_payload/0

View Source
-type control_without_payload() :: udist:dop_without_payload_t().
-type data() :: #data{}.
-type decision() ::
    action() |
    {action(), control_without_payload()} |
    {action(), control_with_payload(), payload()}.
Link to this type

gen_statem_event_content/0

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

Link to this section Callbacks

-callback classify(Hint :: hint(), Sysname :: node(), Control :: control_without_payload()) -> decision().
-callback classify(Hint :: hint(),
         Sysname :: node(),
         Control :: control_with_payload(),
         Payload :: payload()) ->
            decision().
-callback spawn_request_init(Sysname :: node(),
                   Module :: module(),
                   FunctionName :: atom(),
                   Arguments :: [payload()]) ->
                      term() | no_return().

Link to this section 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).
Link to this function

handler_classify(Handler, Hint, Sysname, Control)

View Source
-spec handler_classify(Handler, Hint, Sysname, Control) -> {Hint, Decision}
                    when
                        Handler :: undefined | module(),
                        Hint :: hint(),
                        Sysname :: node(),
                        Control :: control_without_payload(),
                        Decision :: decision().
Link to this function

handler_classify(Handler, Hint, Sysname, Control, Payload)

View Source
-spec handler_classify(Handler, Hint, Sysname, Control, Payload) -> {Hint, Decision}
                    when
                        Handler :: undefined | module(),
                        Hint :: hint(),
                        Sysname :: node(),
                        Control :: control_with_payload(),
                        Payload :: payload(),
                        Decision :: decision().
-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().