From 3fdbd6cd15e1e2911ff51fc32405812852cc5560 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Wed, 19 Nov 2014 08:31:32 -0800 Subject: [PATCH] fix(bitswap/notifications) don't force sender to block on receiver License: MIT Signed-off-by: Brian Tiger Chow --- exchange/bitswap/notifications/notifications.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exchange/bitswap/notifications/notifications.go b/exchange/bitswap/notifications/notifications.go index 2da2b7fad..34888d510 100644 --- a/exchange/bitswap/notifications/notifications.go +++ b/exchange/bitswap/notifications/notifications.go @@ -34,7 +34,7 @@ func (ps *impl) Publish(block blocks.Block) { func (ps *impl) Subscribe(ctx context.Context, k u.Key) <-chan blocks.Block { topic := string(k) subChan := ps.wrapped.SubOnce(topic) - blockChannel := make(chan blocks.Block) + blockChannel := make(chan blocks.Block, 1) // buffered so the sender doesn't wait on receiver go func() { defer close(blockChannel) select {