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

Rationalize backend Semaphore interface slightly #660

Merged
merged 1 commit into from
Dec 20, 2019

Conversation

tomchristie
Copy link
Member

@tomchristie tomchristie commented Dec 20, 2019

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.

@tomchristie tomchristie added the refactor Issues and PRs related to code refactoring label Dec 20, 2019
@tomchristie
Copy link
Member Author

tomchristie commented Dec 20, 2019

After this I'm planning on:

Copy link
Member

@florimondmanca florimondmanca left a comment

Choose a reason for hiding this comment

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

💯 Yes!

@tomchristie tomchristie merged commit 36af9d9 into master Dec 20, 2019
@tomchristie tomchristie 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants