Current section
Files
Jump to
Current section
Files
src/eredis_stream_handler.erl
-module(eredis_stream_handler).
-export([handle_info/3]).
-callback init(Args :: map()) -> ok | {error, Reason :: any()}.
-callback handle_messages(Conn :: map(), Messages :: list(), Config :: term()) -> Stats :: map().
-callback handle_failover(Conn :: map(), Messages :: list(), Config :: term()) -> Stats :: map().
-callback handle_info(Info :: term(), State :: term()) -> {noreply, NewState :: term()}.
-optional_callbacks([handle_info/2]).
-spec handle_info(Mod :: atom(), Info :: term(), State :: term()) ->
{noreply, NewState :: term()}
| {noreply, NewState :: term(), Timeout :: non_neg_integer()}
| {noreply, NewState :: term(), hibernate}
| {noreply, NewState :: term(), {continue, Continue :: term()}}
| {stop, Reason :: term(), NewState :: term()}.
handle_info(Mod, Info, State) ->
case erlang:function_exported(Mod, handle_info, 2) of
true -> Mod:handle_info(Info, State);
false -> {noreply, State}
end.