docs(bitswap/notifications)
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Nov 21, 2014 at 15:41 UTC
1fb80330da0902456be129400c01eaa67bf141b1
1 file changed
+3
-3
exchange/bitswap/notifications/notifications.go
+3
-3
@@ -29,9 +29,9 @@ func (ps *impl) Publish(block *blocks.Block) {
29
ps.wrapped.Pub(block, topic)
30
}
31
32
-// Subscribe returns a one-time use |blockChannel|. |blockChannel| returns nil
33
-// if the |ctx| times out or is cancelled. Then channel is closed after the
34
-// blocks given by |keys| are sent.
32
+// Subscribe returns a channel of blocks for the given |keys|. |blockChannel|
33
+// is closed if the |ctx| times out or is cancelled, or after sending len(keys)
34
+// blocks.
35
func (ps *impl) Subscribe(ctx context.Context, keys ...u.Key) <-chan *blocks.Block {
36
topics := make([]string, 0)
37
for _, key := range keys {