From 975bf93aa536c775b4220407aaa885bc4191af36 Mon Sep 17 00:00:00 2001 From: Nicolas Chapurlat Date: Thu, 20 Jun 2024 10:11:47 +0200 Subject: [PATCH] doc(client): add information about the use of Receipt in StartReceiver Signed-off-by: Nicolas Chapurlat --- v2/client/client.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/v2/client/client.go b/v2/client/client.go index 452304ffd..44941526f 100644 --- a/v2/client/client.go +++ b/v2/client/client.go @@ -47,6 +47,13 @@ type Client interface { // * func(event.Event) (*event.Event, protocol.Result) // * func(context.Context, event.Event) *event.Event // * func(context.Context, event.Event) (*event.Event, protocol.Result) + // Details about the "fn" function returned values: + // When using protocol.NewReceipt, protocol.ResultACK or protocol.ResultNACK as a result + // (*protocol.Receipt implements protocol.Result) rather than an error, + // protocols that support message ack will react regarding Receipt.ACK field. + // Also, Receipts whose ACK field is true will not trigger warning logs. + // A nil result is taken into account as a protocol.Receipt with acked enabled. + // Note that you may use ObservabilityService to setup a custom logging policy. StartReceiver(ctx context.Context, fn interface{}) error }