Readme Error: No sub, no way to Unsub()
jraedisch opened this issue · 5 comments
jraedisch commented
The README.md example seems broken. There is no sub, just subId. Would submit PR but did not find a good way to unsub.
Referenced part of the README.md:
subId, events := pool.Sub(nostr.Filters{
{
Authors: []string{"0ded86bf80c76847320b16f22b7451c08169434837a51ad5fe3b178af6c35f5d"},
Kinds: []int{nostr.KindTextNote}, // or {1}
},
})
go func() {
for event := range nostr.Unique(events) {
log.Print(event)
}
}()
time.Sleep(5 * time.Second)
sub.Unsub()
stanstacks commented
fiatjaf commented
The bug is acknowledged and will be fixed.
I don't understand what you're tagging me and talking about branle. If you are unhappy with the code please send a pull request fixing this or wait until I get to it.
jraedisch commented
Feel free to point me in some direction, maybe I'll be able to prepare a PR.
stanstacks commented
Sometimes I just like to tease you.
Fixed in #20 I hope
stanstacks commented
@jraedisch this is solved, can you confirm and close?