MCPcopy Create free account
hub / github.com/couchbase/couchbase-python-client / run

Method run

acouchbase/transactions/transactions.py:131–143  ·  view source on GitHub ↗
(self,
                  txn_logic,  # type:  Callable[[AttemptContextLogic], Coroutine[Any, Any, None]]
                  transaction_options=None,  # type: Optional[TransactionOptions]
                  **kwargs)

Source from the content-addressed store, hash-verified

129 cluster.cluster_settings.default_serializer)
130
131 async def run(self,
132 txn_logic, # type: Callable[[AttemptContextLogic], Coroutine[Any, Any, None]]
133 transaction_options=None, # type: Optional[TransactionOptions]
134 **kwargs) -> TransactionResult:
135 opts = None
136 if transaction_options:
137 opts = transaction_options._base
138 if 'per_txn_config' in kwargs:
139 Supportability.method_param_deprecated('per_txn_config', 'transaction_options')
140 opts = kwargs.pop('per_txn_config', None)
141
142 txn_result = await super().run_async(txn_logic, AttemptContext(self._txns, self._loop, self._transcoder, opts))
143 return TransactionResult(**txn_result)
144
145 # TODO: make async?
146 def close(self):

Calls 5

TransactionResultClass · 0.90
run_asyncMethod · 0.80
AttemptContextClass · 0.70
popMethod · 0.45