Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

Commit

Permalink
Fix: Queue unintentionally sharing same workers
Browse files Browse the repository at this point in the history
  • Loading branch information
iann838 committed Jan 26, 2023
1 parent 5558a49 commit a3b965b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -8,8 +8,8 @@ Pyot is an asyncIO based high-level Python Riot Games API framework which encour

| Index | Version |
| ---- | ------- |
| PyPI | `6.0.7` |
| master | `6.0.7` |
| PyPI | `6.0.8` |
| master | `6.0.8` |

If you're migrating your project to a newer version of Pyot, please refer to **Changelog** section of the [documentation](https://pyot.paaksing.com).

Expand Down
4 changes: 2 additions & 2 deletions docs/README.md
Expand Up @@ -8,8 +8,8 @@ Pyot is an asyncIO based high-level Python Riot Games API framework which encour

| Index | Version |
| ---- | ------- |
| PyPI | `6.0.7` |
| master | `6.0.7` |
| PyPI | `6.0.8` |
| master | `6.0.8` |

If you're migrating your project to a newer version of Pyot, please refer to **Changelog** section of the documentation.

Expand Down
4 changes: 4 additions & 0 deletions pyot/core/queue.py
Expand Up @@ -37,11 +37,15 @@ def __init__(self, workers: int = 25, maxsize: int = None, log_level: int = 0, e
if workers < 1: raise ValueError('Number of workers must be an integer greater than 0')
self.workers = workers
self.exception_handler = exception_handler
self.responses = {}
self.worker_tasks = []
if maxsize is None:
self.maxsize = workers * 2
else:
self.maxsize = maxsize
self.log_level = log_level
self._queue = asyncio.Queue(maxsize=self.maxsize)
self._id_counter = 0

async def worker(self, queue: asyncio.Queue):
while True:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -32,7 +32,7 @@

setup(
name="pyot",
version="6.0.7",
version="6.0.8",
author="Paaksing",
author_email="paaksingtech@gmail.com",
url="https://github.com/paaksing/Pyot",
Expand Down

0 comments on commit a3b965b

Please sign in to comment.