Interface Transaction
-
- All Superinterfaces:
MessageProducer
- All Known Implementing Classes:
AbstractTransaction
public interface Transaction extends MessageProducer
Represent an asychronous transaction. It can be used to call requests inside a transaction boundary, commit the transaction or rollback it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception>
commit()
Commit the transaction and close the underlying connection.org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception>
rollback()
Rollback the transaction and close the underlying connection.-
Methods inherited from interface io.gridgo.connector.support.MessageProducer
call, callAny, callAny, send, sendAny, sendAny, sendAnyWithAck, sendAnyWithAck, sendWithAck
-
-
-
-
Method Detail
-
commit
org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception> commit()
Commit the transaction and close the underlying connection. This method should be idempotent, i.e calling multiple times has the same effect as calling once.- Returns:
- the transaction itself
-
rollback
org.joo.promise4j.Promise<io.gridgo.framework.support.Message,java.lang.Exception> rollback()
Rollback the transaction and close the underlying connection. This method should be idempotent, i.e calling multiple times has the same effect as calling once. Calling this method aftercommit()
is called has no effect.- Returns:
- the transaction itself
-
-