Last active
December 17, 2021 12:25
-
-
Save dragonsinth/ea1afb8e8f6bcef7076d5e2e84f9fe1e to your computer and use it in GitHub Desktop.
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
promise := eventStream.Subscribe() | |
for { | |
select { | |
case <-ctx.Done(): | |
return ctx.Err() | |
case <-promise.Ready(): | |
v, nextPromise := promise.Next() | |
if v == nil { | |
return nil | |
} | |
promise = nextPromise | |
msg := v.(bwamp.Event) | |
// [Send msg to client] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment