codelipenghui commented on a change in pull request #14218:
URL: https://github.com/apache/pulsar/pull/14218#discussion_r813886119
##########
File path:
pulsar-client/src/main/java/org/apache/pulsar/client/impl/transaction/TransactionImpl.java
##########
@@ -269,11 +250,18 @@ public TxnID getTxnID() {
+ state.name() + ", expect " + State.OPEN + " state!"));
}
+ public synchronized void registerSendOp(CompletableFuture<MessageId>
newSendFuture) {
+ sendFuture = sendFuture.thenCompose(ignore -> newSendFuture);
+ }
+
+ public synchronized void registerAckOp(CompletableFuture<Void>
newAckFuture) {
+ ackFuture = ackFuture.thenCompose(ignore -> newAckFuture);
+ }
- private CompletableFuture<Void> allOpComplete() {
+ public CompletableFuture<Void> prepareCommit() {
Review comment:
The futures for sending messages, acking message should be handled by
users, they are using the FutureUtil or any other tools to process the returned
future.
Introduce the prepareCommit looks like we introduced a new concept about
Pulsar transactions, but essentially it's just a tool for asynchronous
processing
--
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]