-
Notifications
You must be signed in to change notification settings - Fork 53
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
use session for requests #26
Milestone
Comments
konradkonrad
added a commit
to konradkonrad/tinyrpc
that referenced
this issue
Jan 24, 2017
This changes the default behavior of `HttpPostClientTransport` to use a Session instead of creating a new request each time.
konradkonrad
added a commit
to konradkonrad/tinyrpc
that referenced
this issue
Jan 25, 2017
Fixes mbr#26. In some applications it is desirable to limit the number of ports used by a client (see issue mbr#26). This change allows to supply an alternative method to the default `requests.post` being used in `send_message`. The change is introduced backwards compatible with the introduction of a new kwarg to the constructor, `post_method=None`. Users can create a `requests.Session()` instance, (optionally mount a `requests.adapters.HTTPAdapter` to control the pool size), and supply `post_method=session.post` as the kwarg. `test_wsgi_transport.py::sessioned_client` shows an application of the kwarg. `test_wsgi_transport.py::test_exhaust_ports` displays the problem with a non sesioned `HttpPostClientTransport` instance.
konradkonrad
added a commit
to konradkonrad/tinyrpc
that referenced
this issue
Jan 25, 2017
(Backported to `0.5` release tag) Fixes mbr#26. In some applications it is desirable to limit the number of ports used by a client (see issue mbr#26). This change allows to supply an alternative method to the default `requests.post` being used in `send_message`. The change is introduced backwards compatible with the introduction of a new kwarg to the constructor, `post_method=None`. Users can create a `requests.Session()` instance, (optionally mount a `requests.adapters.HTTPAdapter` to control the pool size), and supply `post_method=session.post` as the kwarg. `test_wsgi_transport.py::sessioned_client` shows an application of the kwarg. `test_wsgi_transport.py::test_exhaust_ports` displays the problem with a non sesioned `HttpPostClientTransport` instance.
This was referenced Jan 25, 2017
georgemarshall
pushed a commit
to georgemarshall/tinyrpc
that referenced
this issue
Mar 13, 2018
Fixes mbr#26. In some applications it is desirable to limit the number of ports used by a client (see issue mbr#26). This change allows to supply an alternative method to the default `requests.post` being used in `send_message`. The change is introduced backwards compatible with the introduction of a new kwarg to the constructor, `post_method=None`. Users can create a `requests.Session()` instance, (optionally mount a `requests.adapters.HTTPAdapter` to control the pool size), and supply `post_method=session.post` as the kwarg. `test_wsgi_transport.py::sessioned_client` shows an application of the kwarg. `test_wsgi_transport.py::test_exhaust_ports` displays the problem with a non sesioned `HttpPostClientTransport` instance.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It might be a good idea to use session instead of directly use requests here:
https://github.com/mbr/tinyrpc/blob/master/tinyrpc/transports/http.py#L25
Because with a fast enough server, the number of sockets available will run out quickly.
The text was updated successfully, but these errors were encountered: