Behaviours: gen_server
.
claws() = claws_rabbitmq | claws_xmpp | claws_xmpp_comp
jid() = binary()
code_change/3 | |
connected/1 | reports to the implementation callback the connection (claw) is up. |
disconnected/1 | reports to the implementation callback the connecgtion (claw) is down. |
handle_call/3 | |
handle_cast/2 | |
handle_info/2 | |
init/1 | initialize the snatch process. |
received/1 | received Data, it will be handled directly via the implementation. |
received/2 | received Data, it will be handled directly via the implementation adding the route to know where to send the next data. |
send/1 | send Data to the external connection using the default claw
configured at start of snatch and <<"unknown">> as JID. |
send/2 | send Data to the external connection using a claw based on the JID passed as a param. |
send/3 | send data to the external connection using a claw based on the JID passed as a param. |
start_link/2 | starts the server using snatch as registered name, using Claws param to know what kind of handling of connection to use and PID or Process Name for receive the information comming from the claws. |
start_link/3 | starts the server using snatch as registered name, using Claws param to know what kind of handling of connection to use and Module for the callbacks to send the received information. |
stop/0 | stops the snatch server. |
terminate/2 |
code_change(OldVsn, State, Extra) -> any()
connected(Data::term()) -> ok
reports to the implementation callback the connection (claw) is up.
disconnected(Data::term()) -> ok
reports to the implementation callback the connecgtion (claw) is down.
handle_call(Call, From, S) -> any()
handle_cast(Msg, State) -> any()
handle_info(Info, S) -> any()
init(X1::[term()]) -> {ok, #state{claws = claws(), callback = module(), substate = term()}} | {stop, Reason::atom()}
initialize the snatch process. It could be only one per node.
received(Data::term()) -> ok
received Data, it will be handled directly via the implementation.
received(Data::term(), Via::#via{}) -> ok
received Data, it will be handled directly via the implementation adding the route to know where to send the next data.
send(Data::term()) -> ok
send Data to the external connection using the default claw
configured at start of snatch and <<"unknown">>
as JID.
send(Data::term(), JID::jid()) -> ok
send Data to the external connection using a claw based on the JID passed as a param.
send(Data::term(), JID::jid(), ID::binary()) -> ok
send data to the external connection using a claw based on the JID passed as a param. The ID is sent directly to the claw with the data.
start_link(Claws::claws(), PIDorName::pid() | atom()) -> {ok, pid()} | {error, any()}
starts the server using snatch as registered name, using Claws param to know what kind of handling of connection to use and PID or Process Name for receive the information comming from the claws.
start_link(Claws::claws(), Module::module(), Args::[term()]) -> {ok, pid()} | {error, any()}
starts the server using snatch as registered name, using Claws param to know what kind of handling of connection to use and Module for the callbacks to send the received information. Args could be whatever you need to pass to your init/1 callback.
stop() -> ok
stops the snatch server.
terminate(Reason, State) -> any()