Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pyrogram/pyrogram
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: d-Rickyy-b/pyrogram
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jul 16, 2023

  1. fix(dispatcher): mark tasks as done after taking elements off updates…

    …_queue
    
    This commit fixes an issue where the `updates_queue.join()` method would never return.
    When waiting for the `updates_queue` to get emptied, the asyncio queue implementation relies on an internal counter. This counter is incremented on each `put()` but is not automatically decremented on each `get()`.
    In order to decrement the counter we need to use `updates_queue.task_done()`, as per the [docs](https://docs.python.org/3/library/asyncio-queue.html#asyncio.Queue.task_done). Since this wasn't done in pyrogram yet, there was no proper way to use the `join()` method on the updates_queue and hence wait until all updates got processed.
    
    A workaround would be to use a while loop and check if `updates_queue.empty()` returns true. But using `join()` is just a lot cleaner and does not require a loop on our end.
    d-Rickyy-b committed Jul 16, 2023
    Configuration menu
    Copy the full SHA
    0e57701 View commit details
    Browse the repository at this point in the history
Loading