We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If get_all_messages might receive more than one message, I think it should be changed to:
get_all_messages(Acc) -> receive M -> get_all_messages([M | Acc]) after 0 -> lists:reverse(Acc) end.
The text was updated successfully, but these errors were encountered:
I think there is still a possible race condition.
Maybe we should send connection_ready only if Msgs is empty?
reconnect_loop(Client, #state{reconnect_sleep = ReconnectSleep} = State) -> case catch(connect(State)) of {ok, #state{socket = Socket}} -> gen_tcp:controlling_process(Socket, Client), case get_all_messages([]) of [] -> Client ! {connection_ready, Socket}; _ -> timer:sleep(ReconnectSleep), reconnect_loop(Client, State); {error, _Reason} -> timer:sleep(ReconnectSleep), reconnect_loop(Client, State); %% Something bad happened when connecting, like Redis might be %% loading the dataset and we got something other than 'OK' in %% auth or select _ -> timer:sleep(ReconnectSleep), reconnect_loop(Client, State) end.
Sorry, something went wrong.
No branches or pull requests
If get_all_messages might receive more than one message, I think it should be changed to:
The text was updated successfully, but these errors were encountered: