mirror of
https://github.com/ProxymanApp/atlantis.git
synced 2026-04-26 08:26:04 +03:00
[GH-ISSUE #60] DispatchGroup wait blocks Atlantis delegate #41
Labels
No labels
Done
Done
Windows
bug
bug
bug
enhancement
enhancement
enhancement
good first issue
hacktoberfest
pull-request
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/atlantis#41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sherlouk on GitHub (Feb 23, 2021).
Original GitHub issue: https://github.com/ProxymanApp/atlantis/issues/60
Originally assigned to: @NghiaTranUIT on GitHub.
Hey there 👋
Weird 'bug' (is it a bug? maybe not...) that lost me a good hour this evening 😅
If you have a DispatchGroup and are using the sync
group.wait()function then Atlantis's delegate call is not triggered until after the group has finished.Simplified example, I'm assuming you've already setup Atlantis with a
print("Event Received")in the delegate callIn this example you will see "Starting" "Network Complete" "Finished" "Event Received".
If you switch from
.wait()to.notify()like:Then this works and you get the expected: "Starting", "Event Received", "Network Complete", "Finished".
Essentially with
waitAtlantis doesn't trigger the delegate call until the entire group is finished.@NghiaTranUIT commented on GitHub (Feb 23, 2021):
Hey @Sherlouk,
Since the delegate is called from the main thread, so if you're using
.wait(), it will block the main thread. Therefore, Atlantis's delegate could not be trigger until the Group is finished.Maybe I can introduce the delegate queue, that you can pass the queue you would receive the delegate. It might fix your problem 😄