Commit cc163a95 authored by Brian Tiger Chow's avatar Brian Tiger Chow

docs(bitswap:notifications) Subscribe

parent b1155a0b
......@@ -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)
......
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