From cc163a955d410578891b8981a5b2de5cce57bb01 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Fri, 12 Sep 2014 02:46:38 -0700 Subject: [PATCH] docs(bitswap:notifications) Subscribe --- bitswap/notifications.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bitswap/notifications.go b/bitswap/notifications.go index 8277d160b..39fd42bb7 100644 --- a/bitswap/notifications.go +++ b/bitswap/notifications.go @@ -22,8 +22,9 @@ func (ps *notifications) Publish(block *blocks.Block) { ps.wrapped.Pub(block, topic) } -// Sub returns a one-time use |blockChannel|. |blockChannel| returns nil if the -// |ctx| times out or is cancelled +// Subscribe returns a one-time use |blockChannel|. |blockChannel| returns nil +// if the |ctx| times out or is cancelled. Then channel is closed after the +// block given by |k| is sent. func (ps *notifications) Subscribe(ctx context.Context, k u.Key) <-chan *blocks.Block { topic := string(k) subChan := ps.wrapped.SubOnce(topic)