forked from wooga/eredis
-
Notifications
You must be signed in to change notification settings - Fork 24
Tasks
Bjorn Svensson edited this page Sep 23, 2020
·
5 revisions
A client, like eredis_cluster, uses process_flag(trap_exit, true)
when starting a eredis client using:
eredis:start_link(Address, Port, Options)
We should make sure we dont crash and return an error instead (only applicable with no_reconnect
)
handle_info({tcp, Socket, Data}, #state{socket = Socket} = State) ->
ok = inet:setopts(Socket, [{active, once}]),
{noreply, handle_response(Data, State)};
%% Receive TLS data from socket. Match `Socket' to enforce sanity.
handle_info({ssl, Socket, Data}, #state{socket = Socket} = State) ->
ok = ssl:setopts(Socket, [{active, once}]),
When using reconnect_sleep=no_reconnect there will be no reconnections https://github.com/Nordix/eredis#connect-a-client-start_link0-3