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

10177: Sessions: use the site reactor, not the global one #1587

Merged
merged 5 commits into from May 19, 2021

Conversation

twm
Copy link
Contributor

@twm twm commented Apr 26, 2021

Expose the reactor associated with the Site by renaming the _reactor attribute to reactor in its superclass HTTPFactory. Consider this pursuant to #3205.

Make the Session initializer take the reactor from its site argument when the explicit reactor argument isn't passed. It used to use the global reactor.

There were a few tests that called the Session constructor with incorrect arguments. It looks like the uid used to be an integer, but it's bytes now. Also, a few had the uid and site arguments swapped.

I also added some missing documentation.

See twisted/treq#327 and twisted/treq#328 for background.

Contributor Checklist:

  • The associated ticket in Trac is here: https://twistedmatrix.com/trac/ticket/10177
  • I ran tox -e lint to format my patch to meet the Twisted Coding Standard
  • I have created a newsfragment in src/twisted/newsfragments/ (see: News files)
  • The title of the PR starts with the associated Trac ticket number (without the # character).
  • I have updated the automated tests and checked that all checks for the PR are green.
  • I have submitted the associated Trac ticket for review by adding the word review to the keywords field in Trac, and putting a link to this PR in the comment; it shows up in https://twisted.reviews/ now.

twm added 2 commits April 25, 2021 21:39
Expose the reactor associated with the `Site` by renaming the `_reactor`
attribute to `reactor` in its superclass `HTTPFactory`.

Make the `Session` initializer take the reactor from its *site* argument
when the explicit *reactor* argument isn't passed. It used to use the
global reactor.

There were a few tests that called the `Session` constructor with
incorrect arguments. It looks like the `uid` used to be an integer, but
it's bytes now. Also a few had the *uid* and *site* arguments swapped.

I also added some missing documentation.
Copy link
Member

@wsanchez wsanchez left a comment

Choose a reason for hiding this comment

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

s'ok

@twm
Copy link
Contributor Author

twm commented May 19, 2021

Thank you for the review @wsanchez!

@twm twm merged commit cae3652 into trunk May 19, 2021
@twm twm deleted the getsession-global-reactor-10177 branch May 19, 2021 06:09
@graingert graingert mentioned this pull request Jul 22, 2021
7 tasks
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.

None yet

2 participants