liangyepianzhou commented on code in PR #984:
URL: https://github.com/apache/pulsar-client-go/pull/984#discussion_r1147086912
##########
pulsar/transaction.go:
##########
@@ -17,7 +17,53 @@
package pulsar
+import (
+ "context"
+)
+
+// TxnState The state of the transaction. Check the state of the transaction
before executing some operation
+// with the transaction is necessary.
+type TxnState int32
+
+const (
+ _ TxnState = iota
+ // Open The transaction in Open state can be used to send/ack messages.
+ Open
+ // Committing The state of the transaction will be Committing after the
commit method is called.
+ // The transaction in Committing state can be committed again.
+ Committing
+ // Aborting The state of the transaction will be Aborting after the
abort method is called.
+ // The transaction in Aborting state can be aborted again.
+ Aborting
+ // Committed The state of the transaction will be Committed after the
commit method is executed success.
+ // This means that all the operations with the transaction are success.
+ Committed
+ // Aborted The state of the transaction will be Aborted after the abort
method is executed success.
+ // This means that all the operations with the transaction are aborted.
+ Aborted
+ // Errored The state of the transaction will be Errored after the
operation of transaction get a non-retryable error.
+ Errored
Review Comment:
The Error is a conflict with `Error` in error.go.
```java
type Error struct {
msg string
result Result
}
```
--
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]