-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Closed as not planned
Closed as not planned
Copy link
Labels
Description
Feature or enhancement
Proposal:
Under the declaration of the asyncio.Queue class, in Lib/asyncio/queues.py:
def _wakeup_next(self, waiters):
# Wake up the next waiter (if any) that isn't cancelled.
while waiters:
waiter = waiters.popleft()
if not waiter.done():
waiter.set_result(None)
break
It is clear that the self parameter is not used, since this is just a helper method, to reduce code duplication by separating out the common functionality of unblocking callers in Queue.get and Queue.put, with the waiters deque passed directly. Thus, _wakeup_next should be made static:
@staticmethod
def _wakeup_next(self, waiters):
# Wake up the next waiter (if any) that isn't cancelled.
while waiters:
waiter = waiters.popleft()
if not waiter.done():
waiter.set_result(None)
breakSince _wakeup_next is a private method, this change will be minor.
I will open a PR if required.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Projects
Status
Done