@cryptotaxi247 / kubo / commits / cc163a955

docs(bitswap:notifications) Subscribe

Brian Tiger Chow committed Sep 12, 2014 at 02:46 UTC cc163a955d410578891b8981a5b2de5cce57bb01
1 file changed +3 -2
bitswap/notifications.go
+3 -2
@@ -22,8 +22,9 @@ func (ps *notifications) Publish(block *blocks.Block) {
22 ps.wrapped.Pub(block, topic)
23 }
24
25 -// Sub returns a one-time use |blockChannel|. |blockChannel| returns nil if the
26 -// |ctx| times out or is cancelled
25 +// Subscribe returns a one-time use |blockChannel|. |blockChannel| returns nil
26 +// if the |ctx| times out or is cancelled. Then channel is closed after the
27 +// block given by |k| is sent.
28 func (ps *notifications) Subscribe(ctx context.Context, k u.Key) <-chan *blocks.Block {
29 topic := string(k)
30 subChan := ps.wrapped.SubOnce(topic)