add context to server.SubscriberOptions and broker.SubscribeOption

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2019-01-24 00:46:26 +03:00
parent 7542aafd29
commit ac1afea7fc
4 changed files with 36 additions and 5 deletions

View File

@@ -111,3 +111,10 @@ func TLSConfig(t *tls.Config) Option {
o.TLSConfig = t
}
}
// SubscribeContext set context
func SubscribeContext(ctx context.Context) SubscribeOption {
return func(o *SubscribeOptions) {
o.Context = ctx
}
}