Skip to content

Rationalize backend Semaphore interface slightly - #660

Merged
lovelydinosaur merged 1 commit into
masterfrom
rationalize-semaphore-usage
Dec 20, 2019
Merged

lovelydinosaur merged 1 commit into
masterfrom
rationalize-semaphore-usage

Conversation

@lovelydinosaur

@lovelydinosaur lovelydinosaur commented Dec 20, 2019 •

Copy link
Copy Markdown
Member

Some internal refactoring, to make the usage of backend 'semaphore' and 'event' classes more consistent.

  • Switch to create_semaphore() for consistency with create_event().
  • Stop using BasePoolSemaphore, and instead just use a generic BaseSemaphore. Pass the exc_class=PoolTimeout, so that backend semaphores are not specific to any particular use-case. (We don't strictly need to do this, but I think it feels neater?)
  • Move implementations into more consistent locations, so that event and semaphore implementations are kept close.

@lovelydinosaur lovelydinosaur added the refactor Issues and PRs related to code refactoring label Dec 20, 2019
@lovelydinosaur

lovelydinosaur commented Dec 20, 2019 •

Copy link
Copy Markdown
Member Author

After this I'm planning on:

@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.

馃挴 Yes!

@lovelydinosaur
lovelydinosaur merged commit 36af9d9 into master Dec 20, 2019
@lovelydinosaur
lovelydinosaur deleted the rationalize-semaphore-usage branch December 20, 2019 15:14
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