@@ -59,9 +59,10 @@ type MessageContentUnmarshaler = topicreadercommon.PublicMessageContentUnmarshal
5959
6060// Commit receive Message, Batch of single offset
6161// It can be fast (by default) or sync and waite response from server
62- // see topicoptions.CommitMode for details
63- //
64- // for topicoptions.CommitModeSync mode sync the method can return ErrCommitToExpiredSession
62+ // see topicoptions.CommitMode for details.
63+ // Fast mode of commit (default) - store commit info to internal buffer only and send it to the server later.
64+ // Close the reader for wait to send all commits to the server.
65+ // For topicoptions.CommitModeSync mode sync the method can return ErrCommitToExpiredSession
6566// it means about the message/batch was not committed because connection broken or partition routed to
6667// other reader by server.
6768// Client code should continue work normally
@@ -160,9 +161,9 @@ type Batch = topicreadercommon.PublicBatch
160161// ReadBatchOption is type for options of read batch
161162type ReadBatchOption = topicreaderinternal.PublicReadBatchOption
162163
163- // Close stop work with reader
164- // return when reader complete internal works, flush commit buffer, ets
165- // or when ctx cancelled
164+ // Close stop work with reader.
165+ // return when reader complete internal works, flush commit buffer. You should close the Reader after use and before
166+ // exit from a program for prevent lost last commits.
166167func (r * Reader ) Close (ctx context.Context ) error {
167168 // close must be non-concurrent with read and commit
168169
0 commit comments