snapshot of https://github.com/ThreeDotsLabs/watermill.git (master, 2026-09-15; blobs > 131072B omitted)
Some checks failed
master / ci (push) Failing after 0s
Some checks failed
master / ci (push) Failing after 0s
This commit is contained in:
14
message/router/middleware/instant_ack.go
Normal file
14
message/router/middleware/instant_ack.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package middleware
|
||||
|
||||
import "github.com/ThreeDotsLabs/watermill/message"
|
||||
|
||||
// InstantAck makes the handler instantly acknowledge the incoming message, regardless of any errors.
|
||||
// It may be used to gain throughput, but at a cost:
|
||||
// If you had exactly-once delivery, you may expect at-least-once instead.
|
||||
// If you had ordered messages, the ordering might be broken.
|
||||
func InstantAck(h message.HandlerFunc) message.HandlerFunc {
|
||||
return func(message *message.Message) ([]*message.Message, error) {
|
||||
message.Ack()
|
||||
return h(message)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user