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

Static timeout values in Conn #10

Closed
h4cc opened this issue May 29, 2017 · 6 comments
Closed

Static timeout values in Conn #10

h4cc opened this issue May 29, 2017 · 6 comments

Comments

@h4cc
Copy link
Contributor

h4cc commented May 29, 2017

It would be cool, if these two numbers could be part of the Conn-struct and interchangeable via options.

https://github.com/Azolo/websockex/blob/master/lib/websockex/conn.ex#L92
https://github.com/Azolo/websockex/blob/master/lib/websockex/conn.ex#L188

@Azolo
Copy link
Owner

Azolo commented May 29, 2017

There's no reason I can think of that they couldn't be. Feel like opening a PR?

@h4cc
Copy link
Contributor Author

h4cc commented Jun 1, 2017

I am feeling it 💃

h4cc added a commit to h4cc/websockex that referenced this issue Jun 1, 2017
@h4cc
Copy link
Contributor Author

h4cc commented Jun 1, 2017

@Azolo Might you have a look at commit ddc50b4 before PR?

@Azolo
Copy link
Owner

Azolo commented Jun 1, 2017

It looks good, I left a couple of comments.

But I think I prefer the Conn struct flat for the sake of discoverability. Someone can open up IEx and do something like:

iex> struct(WebSockex.Conn)
%WebSockex.Conn{cacerts: nil, conn_mod: nil, extra_headers: [], host: nil,
 insecure: true, path: nil, port: nil, query: nil, socket: nil, transport: nil,
 socket_connect_timeout: 6000, socket_recv_timeout: 5000}

But functionality wise, it looks spot on.

h4cc added a commit to h4cc/websockex that referenced this issue Jun 6, 2017
@h4cc
Copy link
Contributor Author

h4cc commented Jun 6, 2017

Thanks for your feedback, i updated the implementation.

Azolo pushed a commit that referenced this issue Jun 6, 2017
* Added socket_opts to WebSockex.Conn struct with possible keys :connect_timeout and :recv_timeout. Closes Issue #10

* Changed implementation from keyword list for socket_opts to dedicated values in Conn struct. Issue #10
@Azolo
Copy link
Owner

Azolo commented Jun 6, 2017

Closed by #15

@Azolo Azolo closed this as completed Jun 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants