lhotari commented on code in PR #29:
URL:
https://github.com/apache/pulsar-client-reactive/pull/29#discussion_r1033304281
##########
pulsar-client-reactive-api/src/main/java/org/apache/pulsar/reactive/client/api/ReactiveMessageReader.java:
##########
@@ -20,10 +20,25 @@
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
+/**
+ * Reactive message reader interface.
+ *
+ * @param <T> the message payload type.
+ * @author Lari Hotari
+ * @author Christophe Bornet
+ */
public interface ReactiveMessageReader<T> {
+ /**
+ * Read one message.
+ * @return the message read
+ */
Mono<Message<T>> readOne();
+ /**
+ * Read messages continuously.
+ * @return the messages read
+ */
Flux<Message<T>> readMany();
Review Comment:
It would be useful to refer to
ReactiveMessageReaderBuilder#endOfStreamAction in the documentation for these
methods. When endOfStreamAction == EndOfStreamAction#COMPLETE, readOne will
return an empty Mono if the reader reaches the end of the stream of messages.
I'll add a separate issue to document endOfStreamAction.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]