Commit 468e7655 authored by Jeromy's avatar Jeromy

select with context when sending on channels

License: MIT
Signed-off-by: default avatarJeromy <jeromyj@gmail.com>
parent 8cb50134
......@@ -168,11 +168,17 @@ func (mq *msgQueue) runQueue(ctx context.Context) {
}
func (pm *WantManager) Connected(p peer.ID) {
pm.connect <- p
select {
case pm.connect <- p:
case <-pm.ctx.Done():
}
}
func (pm *WantManager) Disconnected(p peer.ID) {
pm.disconnect <- p
select {
case pm.disconnect <- p:
case <-pm.ctx.Done():
}
}
// TODO: use goprocess here once i trust it
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment