Request to commit/rollback a transaction.
(
&mut self,
transaction_id: Bytes,
action: EndTransaction,
)
| 423 | |
| 424 | /// Request to commit/rollback a transaction. |
| 425 | pub async fn end_transaction( |
| 426 | &mut self, |
| 427 | transaction_id: Bytes, |
| 428 | action: EndTransaction, |
| 429 | ) -> Result<()> { |
| 430 | let cmd = ActionEndTransactionRequest { |
| 431 | transaction_id, |
| 432 | action: action as i32, |
| 433 | }; |
| 434 | let action = Action { |
| 435 | r#type: END_TRANSACTION.to_string(), |
| 436 | body: cmd.as_any().encode_to_vec().into(), |
| 437 | }; |
| 438 | let req = self.set_request_headers(action.into_request())?; |
| 439 | let _ = self.flight_client.do_action(req).await?.into_inner(); |
| 440 | Ok(()) |
| 441 | } |
| 442 | |
| 443 | /// Explicitly shut down and clean up the client. |
| 444 | pub async fn close(&mut self) -> Result<()> { |