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

Scenario tutorial uses outdated code #100

Closed
qrilka opened this issue Feb 15, 2017 · 7 comments
Closed

Scenario tutorial uses outdated code #100

qrilka opened this issue Feb 15, 2017 · 7 comments

Comments

@qrilka
Copy link

qrilka commented Feb 15, 2017

doc/scenarios/tutorial.md sets up target webserver as

    set_host("localhost")
    set_port(8080)

But in workers/http/examples/localhost.bdl I see

connect("localhost", 8080)
@parsifal-47
Copy link
Contributor

Fixed,
thanks for reporting this!

@qrilka
Copy link
Author

qrilka commented Feb 15, 2017

@parsifal-47 side question - I haven't found a way to pass headers to http_worker but as I just wanted to disable keepalive using set_options(connection = close) seem to work and connect/disconnect as in keepalive.bdl in examples does not seem to prevent keepalive (though I didn't dig deeper yet)

@parsifal-47
Copy link
Contributor

Not sure if I got your question,
set_options should be the method you looking for, it sets headers for http request.
In keepalive.bdl example clients are reconnected with disconnect and connect method.

Do you need server to close connection after each request?
Does it look like headers are not passing to HTTP request?

@qrilka
Copy link
Author

qrilka commented Feb 15, 2017

@parsifal-47 I was using connect/disconnect approach from keepalive.bdl and it didn't result in connection being closed - keepalive get's used by default and I saw connection being reused in tcpdump. I guess hackney moves that connection back to the pool on close(though I didn't check that running Erlang code myself)

@parsifal-47
Copy link
Contributor

thanks, now I got it, I'll check that tomorrow

@qrilka
Copy link
Author

qrilka commented Feb 15, 2017

thanks, otherwise feel free to close this ticket @parsifal-47 :)

@parsifal-47
Copy link
Contributor

I've disabled dynamic connection sharing, it is in master and checked with tcpdump

Thanks again for reporting this!

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

No branches or pull requests

2 participants