diff options
Diffstat (limited to 'setup/jetstream/helpers.go')
-rw-r--r-- | setup/jetstream/helpers.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/setup/jetstream/helpers.go b/setup/jetstream/helpers.go new file mode 100644 index 00000000..2d563226 --- /dev/null +++ b/setup/jetstream/helpers.go @@ -0,0 +1,11 @@ +package jetstream + +import "github.com/nats-io/nats.go" + +func WithJetStreamMessage(msg *nats.Msg, f func(msg *nats.Msg) bool) { + if f(msg) { + _ = msg.Ack() + } else { + _ = msg.Nak() + } +} |