Skip to content

Commit

Permalink
doc(client): add information about the use of Receipt in StartReceiver
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Chapurlat <nc@coorganix.com>
  • Loading branch information
chapurlatn committed Jun 20, 2024
1 parent 61c7e78 commit 975bf93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions v2/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 975bf93

Please sign in to comment.