Merge lp:~robru/friends/dont-block-refresh into lp:friends
Proposed by
Robert Bruce Park
Status: | Merged |
---|---|
Merged at revision: | 90 |
Proposed branch: | lp:~robru/friends/dont-block-refresh |
Merge into: | lp:friends |
Diff against target: |
78 lines (+27/-16) 2 files modified
friends/service/dispatcher.py (+7/-10) friends/tests/test_dispatcher.py (+20/-6) |
To merge this branch: | bzr merge lp:~robru/friends/dont-block-refresh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ken VanDine | Approve | ||
Ricardo Mendoza | Pending | ||
Review via email: mp+138620@code.launchpad.net |
Description of the change
This change prevents Twitter's rate limiter from being able to block the whole MainThread when Dispatcher.Refresh tries to join() all previous threads.
Instead, we now simply abort Dispatcher.Refresh if there is a previous refresh still pending. This approach allows Dispatcher.Refresh to always return immediately, so that it stops blocking the GLib mainloop and the Dee model, without causing any problems with multiple concurrent refreshes stepping on each other's toes, or running afoul of twitter's rate limiter.
To post a comment you must log in.
Does the main thread counts as 1 in threading. activeCount( ) ?