-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor and cleanup #7
Conversation
2b5e981
to
3687951
Compare
3687951
to
5a3663a
Compare
d8bcb0b
to
49d0277
Compare
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.
The only thing I'm unsure of is the use of asyncio.run
that I've commented for you.
Both versions, with or without the asyncio.run
wrapper did work correctly. Actually it seems like that the current contents of the start_async_thread
function might be doing a very similar job to the asyncio.run
function.
5689aaa
to
8f69f7b
Compare
8f69f7b
to
8c2c875
Compare
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.
I've actually encountered a warning regarding the proper cleanup of resources, but it's not related to the way how we start off the async function in a new thread (or at the very least, I get the same warning regardless of whether I use the old or the new implementation of functions found in the threads.py
file)
Warning: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown
How to reproduce (if you're interested): Start the app from terminal using uvicorn
command and then, once everything is set up, terminate the app by using CTRL C shortcut.
TODO: For now I shall put it to backlog, it's not that pressing at the moment. The number of leaked semaphores doesn't increase with the number of spawned new threads utilizing a scheduler which is nice...
Adding a link to the newly created issue #24 that captures this. |
Change
Slight refactoring and cleanup of the code.
This change includes addition of Ruff formatter and creation of Github workflows.
How to Test
Does not require any additional testing as functionality is not being changed
Checklist
Related Issues
None