#337 Add a requests session registry for Hubs to use
Closed by jcline. Opened by jcline.
jcline/fedora-hubs session-registry  into  develop

Download 337.patch

All requests go through the session registry. This allows requests made from the same Python thread to share TCP connections which greatly improves the performance of HTTP requests. It also gives us a place to globally configure sessions (for things like retries, global headers, etc.)

If this looks like a good idea to other people, I'll probably see if requests-toolbelt would accept a PR with this and we can switch to that if they accept it and make a release with it.

fixes #336

Why the :'s?

This example function doesn't return the session, but the sentence above sounds like it was meant to.

You could docblock the parameter to say that it is a function.

This should probably be mentioned in the docblock.

sportsesh

Nice!

Just a few suggestions that you can take or leave. LGTM.

Sphinx will render this as a docblock for the module-level variable.

You're right. I wrote this as a docblock first, then copied it into a test, found that bug, and forgot to update the docblock.

I did as part of the class docblock (Args). The napoleon style guide indicates this is fine, but that it's also possible to document it on the init function instead. If you do that, though, you need to throw in a :special-members: directive when using autodoc. I'm fine with both approaches. Which do you like more?

Ah that sounds fine. Carry on!

rebased

@jcline can you rebase this PR?

is this PR still being worked on? If not, we should close to clean up the queue a bit.

Pull-Request has been closed by jcline

Metadata