Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ type OrderedDelivery interface {
// substitute for per-message settlement.
type Batched interface {
// NextBatch returns up to limit messages, blocking for at least one, or
// ctx.Err()/ErrDrained as [Subscription.Next] would.
// ctx.Err()/ErrDrained as [Subscription.Next] would. A limit below one is
// treated as one.
NextBatch(ctx context.Context, limit int) ([]Message, error)
// SettleBatch applies the single result r to every message in ms in one call.
// It is for a caller settling a uniform batch directly; the Hopper settles per
Expand Down
2 changes: 2 additions & 0 deletions source/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ func Skip() Result { return Result{Action: ActionAck, Class: Drop} }
func InProgress() Result { return Result{Action: ActionInProgress} }

// Manual returns a Result reporting the handler settled the message itself.
// The message's in-flight slot is released like any other settle — drain
// accounting treats Manual as settled — but the backend takes no action.
func Manual() Result { return Result{Action: ActionManual} }

// Failed reports whether the result carries a failure (anything that is not a
Expand Down
7 changes: 5 additions & 2 deletions source/kafka/capability.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,11 @@ func toRecordHeaders(hs source.Headers) []kgo.RecordHeader {
// m's offset is marked only after fn succeeds and only inside the transaction, so
// a failed transform never advances the consumed position: the commit-after-
// process invariant holds, now atomically with the produce side. Begin is the
// full settle path for m; the caller must not also call [Subscription.Settle] for
// m.
// full settle path for m; the caller must not also call [Subscription.Settle]
// for m. A direct Settle for m during an open Begin, or after Begin returned,
// is a caller error with undefined results — it is not detected or coordinated
// with the transaction: at best it duplicates an already-committed mark
// (harmless at-least-once), at worst it races End's commit/abort.
//
// It is available only when the inlet was built with [WithTransactional];
// otherwise it reports the capability is absent rather than silently running fn
Expand Down