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

fix(bitswap/notifications) don't force sender to block on receiver

License: MIT
Signed-off-by: default avatarBrian Tiger Chow <brian@perfmode.com>
parent 0b529b13
......@@ -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 {
......
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