-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add locking functionality to the priority queue #293
Conversation
The I also think we will keep running into issues like this if we keep on using threading, because threading is just very hard to get right. I also can't think of a reason why we need to use threading, so I think it would be a good idea if we switch to asyncio in the future and get rid of most concurrency issues doing this. FastAPI is build around asyncio, so it shouldn't be hard to do, see https://fastapi.tiangolo.com/async/ With asyncio we can the just use |
yes was about to remove it, this is an artifact of debugging. I'll have a look for the implications of using asyncio. And I agree on the formalization of postgresql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Although I'm not sure yet if using queue.Queue
in the tests is the way to go since that queue implementation itself is already thread-safe
Minimum allowed coverage is Generated by 🐒 cobertura-action against 251bc56 |
Solve race conditions of multiple workers popping off the same task from the queue