停止规则与事故接管
原能力
实施停止合同和事故接管,分别记录请求、送达、实际停止和未决结果。(合同附件 R7 23.9)
首选项目
Temporal Python SDK(MIT,限 SDK)。 Temporal Python SDK
匹配范围
告警、取消和人工接管机制。
源码
Temporal Python SDK · async def cancel(
temporalio/client/_workflow.py · 326–339 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
async def cancel(
self,
*,
reason: str = "",
rpc_metadata: Mapping[str, str | bytes] = {},
rpc_timeout: timedelta | None = None,
) -> None:
"""Cancel the workflow.
This will issue a cancellation for :py:attr:`run_id` if present. This
call will make sure to use the run chain starting from
:py:attr:`first_execution_run_id` if present. To create handles with
these values, use :py:meth:`Client.get_workflow_handle`.
Temporal Python SDK · async def wait_condition(
temporalio/workflow/_context.py · 1028–1041 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
async def wait_condition(
fn: Callable[[], bool],
*,
timeout: timedelta | float | None = None,
timeout_summary: str | None = None,
event_groups: Sequence[EventGroup] | None = None,
) -> None:
"""Wait on a callback to become true.
This function returns when the callback returns true (invoked each loop
iteration) or the timeout has been reached.
Importantly, using `None` value for ``timeout`` means that no Temporal timer is created. This
means changing from `None` to a positive value (or the inverse) constitutes a nondeterministic
实现与验收要点
真实停止、在途效果、恢复条件和证据。