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

Implement asyncio instead of threading for better concurrency handling #23

Closed
birdhouses opened this issue Apr 25, 2023 · 1 comment
Closed
Assignees
Labels
enhancement New feature or request

Comments

@birdhouses
Copy link
Owner

Issue description

Currently, our project uses threading for handling concurrency and parallel processing of tasks. While this approach works, it may not be the most efficient and scalable solution. As our project continues to grow and evolve, we would like to switch to using asyncio instead of threading to achieve better performance and resource management.

Background

Asyncio is a Python library that provides an asynchronous event loop, coroutines, and other tools for handling concurrency in a more efficient and scalable way. This allows our application to handle multiple tasks concurrently without the need for threads, which can lead to improved performance and reduced resource consumption.

Proposed Changes

  • Replace the threading library with the asyncio library in our project's
  • Refactor the existing code that uses threads to use asyncio coroutines and asynchronous functions
  • Update any related documentation to reflect the change from threading to asyncio.

Expected Benefits

By implementing asyncio instead of threading, we expect the following

  • Improved performance: asyncio is generally more efficient than threading when it comes to handling concurrent tasks in Python, especially for I/O-bound
  • Easier debugging: Debugging asynchronous code can be simpler than debugging threaded code, as there is no need to deal with thread-safety
  • Better resource management: Asynchronous code can often handle more tasks concurrently with fewer resources than threaded code, leading to reduced memory and CPU usage.
@birdhouses birdhouses added the enhancement New feature or request label Apr 25, 2023
@birdhouses birdhouses self-assigned this Apr 25, 2023
@birdhouses birdhouses linked a pull request Apr 26, 2023 that will close this issue
@birdhouses
Copy link
Owner Author

Fixed in #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant