mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 14:58:03 +08:00
fix(bitswap/notifications) don't force sender to block on receiver
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
parent
f6235c5cc6
commit
3fdbd6cd15
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user