fix: propagate relay subscribe opt properly (#829)

This commit is contained in:
Prem Chaitanya Prathi 2023-10-25 02:11:42 +05:30 committed by GitHub
parent 077df2fbb6
commit a3c3aab44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -24,6 +24,12 @@ func DontConsume() BroadcasterOption {
}
}
func WithConsumerOption(dontConsume bool) BroadcasterOption {
return func(params *BroadcasterParameters) {
params.dontConsume = dontConsume
}
}
// WithBufferSize option let's a user set channel buffer to be set.
func WithBufferSize(size int) BroadcasterOption {
return func(params *BroadcasterParameters) {

View File

@ -339,7 +339,8 @@ func (w *WakuRelay) subscribe(ctx context.Context, contentFilter waku_proto.Cont
}
}
subscription := w.bcaster.Register(cFilter, WithBufferSize(DefaultRelaySubscriptionBufferSize))
subscription := w.bcaster.Register(cFilter, WithBufferSize(DefaultRelaySubscriptionBufferSize),
WithConsumerOption(params.dontConsume))
// Create Content subscription
w.topicsMutex.RLock()