Commit c51b5c9f authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Merge pull request #1367 from ipfs/wantmanager-cleanup

select with context when sending on channels
parents d06b99b3 468e7655
......@@ -181,11 +181,17 @@ func (mq *msgQueue) doWork(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