Skip to content

Commit

Permalink
Merge pull request #1606 from ydb-platform/commit-docs
Browse files Browse the repository at this point in the history
improve comments
  • Loading branch information
rekby authored Jan 15, 2025
2 parents dcd59fa + e998a99 commit 0e361e6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions topic/topicreader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ type MessageContentUnmarshaler = topicreadercommon.PublicMessageContentUnmarshal

// Commit receive Message, Batch of single offset
// It can be fast (by default) or sync and waite response from server
// see topicoptions.CommitMode for details
//
// for topicoptions.CommitModeSync mode sync the method can return ErrCommitToExpiredSession
// see topicoptions.CommitMode for details.
// Fast mode of commit (default) - store commit info to internal buffer only and send it to the server later.
// Close the reader for wait to send all commits to the server.
// For topicoptions.CommitModeSync mode sync the method can return ErrCommitToExpiredSession
// it means about the message/batch was not committed because connection broken or partition routed to
// other reader by server.
// Client code should continue work normally
Expand Down Expand Up @@ -160,9 +161,9 @@ type Batch = topicreadercommon.PublicBatch
// ReadBatchOption is type for options of read batch
type ReadBatchOption = topicreaderinternal.PublicReadBatchOption

// Close stop work with reader
// return when reader complete internal works, flush commit buffer, ets
// or when ctx cancelled
// Close stop work with reader.
// return when reader complete internal works, flush commit buffer. You should close the Reader after use and before
// exit from a program for prevent lost last commits.
func (r *Reader) Close(ctx context.Context) error {
// close must be non-concurrent with read and commit

Expand Down

0 comments on commit 0e361e6

Please sign in to comment.