-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alternative to #963. Instead of using atomics, this patch ensures that all state changes are performed on the main thread. It also: * Threads the context through explicitly to make sure fields changed by the main thread are never read by the handler goroutines. This isn't strictly necessary but it makes it easier to reason about. * Uses a callback to signal "on done". There may be cleaner ways to do this (I hate callbacks), but this nicely decouples the peer handler from the main loop. fixes #963
- Loading branch information
Showing
3 changed files
with
71 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters