pubsub_iface_v4.diff

· erock's pastes · raw

expires: 2024-12-24

 1diff --git a/pubsub.go b/pubsub.go
 2index c6de162..3536a1f 100644
 3--- a/pubsub.go
 4+++ b/pubsub.go
 5@@ -218,8 +218,9 @@ type PubSub interface {
 6 	GetChannels() []*Channel
 7 	GetPipes() []*Pipe
 8 	Pipe(pipeClient *PipeClient, pipes []*Pipe) error
 9-	Sub(sub *Sub, channels []*Channel) error
10-	Pub(pub *Pub, channel []*Channel) error
11+	AddChannel(*Channel) error
12+	Sub(sub *Sub, matcher func(sub *Sub, ch *Channel) bool) error
13+	Pub(pub *Pub, matcher func(pub *Pub, ch *Channel) bool) error
14 }
15 
16 type Cfg struct {