Skip to content

Switch from an Event primitive to a Lock primitive - #693

Merged
lovelydinosaur merged 1 commit into
masterfrom
switch-event-to-lock
Dec 29, 2019
Merged

lovelydinosaur merged 1 commit into
masterfrom
switch-event-to-lock

Conversation

@lovelydinosaur

Copy link
Copy Markdown
Member

As noted in #660 (comment)

This will allow us to then:

@lovelydinosaur lovelydinosaur added the refactor Issues and PRs related to code refactoring label Dec 29, 2019
@florimondmanca
florimondmanca self-requested a review December 29, 2019 15:51

@florimondmanca florimondmanca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice!

Comment thread httpx/dispatch/http2.py
Comment on lines +59 to 64
async with self.init_lock:
if not self.sent_connection_init:
# The very first stream is responsible for initiating the connection.
await self.send_connection_init(timeout)
self.sent_connection_init = True
stream_id = self.state.get_next_available_stream_id()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Took me some time to realise this works as expected, but it does seem to!

@lovelydinosaur
lovelydinosaur merged commit 1f9d015 into master Dec 29, 2019
@lovelydinosaur
lovelydinosaur deleted the switch-event-to-lock branch December 29, 2019 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Issues and PRs related to code refactoring

Development

Successfully merging this pull request may close these issues.

2 participants