problem: can't unsub
This commit is contained in:
@@ -24,7 +24,7 @@ for notice := range pool.Notices {
|
||||
### Listening for events
|
||||
|
||||
```go
|
||||
subId, events := pool.Sub(nostr.Filters{
|
||||
subId, events, unsub := pool.Sub(nostr.Filters{
|
||||
{
|
||||
Authors: []string{"0ded86bf80c76847320b16f22b7451c08169434837a51ad5fe3b178af6c35f5d"},
|
||||
Kinds: []int{nostr.KindTextNote}, // or {1}
|
||||
@@ -38,7 +38,7 @@ go func() {
|
||||
}()
|
||||
|
||||
time.Sleep(5 * time.Second)
|
||||
sub.Unsub()
|
||||
close(unsub)
|
||||
```
|
||||
|
||||
### Publishing an event
|
||||
@@ -84,4 +84,4 @@ fmt.Println("pk:", nostr.GetPublicKey(sk))
|
||||
|
||||
```
|
||||
go run example/example.go
|
||||
```
|
||||
```
|
||||
Reference in New Issue
Block a user