aboutsummaryrefslogtreecommitdiff
path: root/setup/jetstream/helpers.go
blob: 1891b96b34a46cfd729fb839394d1aaf78bb47c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
package jetstream

import "github.com/nats-io/nats.go"

func WithJetStreamMessage(msg *nats.Msg, f func(msg *nats.Msg) bool) {
	_ = msg.InProgress()
	if f(msg) {
		_ = msg.Ack()
	} else {
		_ = msg.Nak()
	}
}