跳转到正文

business API ​

完整接口目录 · 存储与服务用法 · 工具包下载

模块说明 ​

text
Persistent business results committed atomically with plugin state and intents.

An online service may expose begin/get through its own business API. This stores
no other plugin's data and never retries business callbacks or game effects.

BusinessConflict ​

python
class BusinessConflict(ValueError)

另继承外部类型 ValueError;其通用方法不在本 SDK 目录中重复展开。

Business ​

python
class Business

Business.__init__ ​

python
def __init__(self, storage)

Business.once ​

python
async def once(self, business_key, prepare, *, keys=None)

SDK 说明:

text
Retain one native service request, its state and complete child intents.

prepare(tx) must only prepare local state/actions synchronously. Matching
retries recover the original commit and IDs without running it again.

Business.get ​

python
async def get(self, business_id)

Business.begin ​

python
async def begin(self, business_id, request, *, keys=None)

SDK 说明:

text
Read a transaction or its previous result. Conflict never reruns logic.

Business.storage ​

python
self.storage

公开实例属性,在 __init__ 中设置。

BusinessTransaction ​

python
class BusinessTransaction

BusinessTransaction.__init__ ​

python
def __init__(self, business, transaction, identity, key, digest, receipt)

BusinessTransaction.commit ​

python
async def commit(self, result)

BusinessTransaction.business ​

python
self.business

公开实例属性,在 __init__ 中设置。

BusinessTransaction.state ​

python
self.state

公开实例属性,在 __init__ 中设置。

BusinessTransaction.business_id ​

python
self.business_id

公开实例属性,在 __init__ 中设置。

BusinessTransaction.key ​

python
self.key

公开实例属性,在 __init__ 中设置。

BusinessTransaction.digest ​

python
self.digest

公开实例属性,在 __init__ 中设置。

BusinessTransaction.receipt ​

python
self.receipt

公开实例属性,在 __init__、commit 中设置。

Neomega · 使用、开发与参考文档