Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (19 sloc) 332 Bytes
package main
import (
"log"
"time"
"github.com/ThreeDotsLabs/watermill/message"
)
func main() {
msg := message.NewMessage("1", []byte("foo"))
go func() {
time.Sleep(time.Millisecond * 10)
msg.Ack()
}()
select {
case <-msg.Acked():
log.Print("ack received")
case <-msg.Nacked():
log.Print("nack received")
}
}