Bump reva to get latest changes for LDAP client

This commit is contained in:
root
2023-07-10 10:04:33 +00:00
committed by Ralf Haferkamp
parent 99f27e569d
commit 6989b17a13
34 changed files with 1293 additions and 283 deletions
+10
View File
@@ -112,6 +112,16 @@ func (s *stream) Publish(topic string, msg interface{}, opts ...events.PublishOp
}
// publish the event to the topic's channel
// publish synchronously if configured
if s.opts.SyncPublish {
_, err := s.natsJetStreamCtx.Publish(event.Topic, bytes)
if err != nil {
err = errors.Wrap(err, "Error publishing message to topic")
}
return err
}
// publish asynchronously by default
if _, err := s.natsJetStreamCtx.PublishAsync(event.Topic, bytes); err != nil {
return errors.Wrap(err, "Error publishing message to topic")
}
+13 -5
View File
@@ -8,11 +8,12 @@ import (
// Options which are used to configure the nats stream.
type Options struct {
ClusterID string
ClientID string
Address string
TLSConfig *tls.Config
Logger logger.Logger
ClusterID string
ClientID string
Address string
TLSConfig *tls.Config
Logger logger.Logger
SyncPublish bool
}
// Option is a function which configures options.
@@ -52,3 +53,10 @@ func Logger(log logger.Logger) Option {
o.Logger = log
}
}
// SynchronousPublish allows using a synchronous publishing instead of the default asynchronous
func SynchronousPublish(sync bool) Option {
return func(o *Options) {
o.SyncPublish = sync
}
}