Skip to content
New issue

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

Important refactorization #139

Merged
merged 2 commits into from
Feb 1, 2017

Conversation

ferigis
Copy link
Member

@ferigis ferigis commented Jan 31, 2017

@ferigis ferigis added this to the 2.0.0 milestone Jan 31, 2017
-spec init(connection()) -> {ok, State :: state()}.
init(Connection) ->
-spec init(list()) -> {ok, State :: state()}.
init([Connection, Client]) ->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, when you have something that has a fixed number of elements, you use a tuple ({Connection, Client}) not a list.

{GunMonitor, GunConnectionPid} = open_gun_connection(Connection),
% wait until the connection is established
self() ! {wait_gun_up, Client},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use 0 timeout mechanism instead of self messaging here?

@elbrujohalcon elbrujohalcon merged commit 7990fdc into master Feb 1, 2017
@elbrujohalcon elbrujohalcon deleted the ferigis.138.improve_response_handling branch February 1, 2017 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling responses improvement
2 participants