migrate to xsync/v3

closes https://github.com/nbd-wtf/go-nostr/issues/117
This commit is contained in:
fiatjaf
2024-01-10 06:54:52 -03:00
parent fd8b2b22b2
commit 7b292775c0
4 changed files with 10 additions and 10 deletions

View File

@@ -8,7 +8,7 @@ import (
"sync"
"time"
"github.com/puzpuzpuz/xsync/v2"
"github.com/puzpuzpuz/xsync/v3"
)
const (
@@ -37,7 +37,7 @@ func NewSimplePool(ctx context.Context, opts ...PoolOption) *SimplePool {
ctx, cancel := context.WithCancel(ctx)
pool := &SimplePool{
Relays: xsync.NewMapOf[*Relay](),
Relays: xsync.NewMapOf[string, *Relay](),
Context: ctx,
cancel: cancel,
@@ -100,7 +100,7 @@ func (pool *SimplePool) subMany(ctx context.Context, urls []string, filters Filt
ctx, cancel := context.WithCancel(ctx)
_ = cancel // do this so `go vet` will stop complaining
events := make(chan IncomingEvent)
seenAlready := xsync.NewMapOf[Timestamp]()
seenAlready := xsync.NewMapOf[string, Timestamp]()
ticker := time.NewTicker(seenAlreadyDropTick)
eose := false
@@ -222,7 +222,7 @@ func (pool *SimplePool) subManyEose(ctx context.Context, urls []string, filters
ctx, cancel := context.WithCancel(ctx)
events := make(chan IncomingEvent)
seenAlready := xsync.NewMapOf[bool]()
seenAlready := xsync.NewMapOf[string, bool]()
wg := sync.WaitGroup{}
wg.Add(len(urls))