和顺 / 衡律 返回所属 Agent
2.4

触发规则与事件时间

原能力

按事件时间和实际可得时间触发处理,保留迟到、更正和补发事件。(合同附件 R7 2.4)

首选项目

Temporal Python SDK(MIT,限 SDK)。 Temporal Python SDK

匹配范围

持久计时与业务/系统时间字段对照。

源码

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

DuckDB · PhysicalAsOfJoin::

src/execution/operator/join/physical_asof_join.cpp · 18–31 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
PhysicalAsOfJoin::PhysicalAsOfJoin(PhysicalPlan &physical_plan, LogicalComparisonJoin &op, PhysicalOperator &left,
                                   PhysicalOperator &right, vector<column_t> lhs_partition_cols,
                                   vector<column_t> rhs_partition_cols)
    : PhysicalComparisonJoin(physical_plan, op, PhysicalOperatorType::ASOF_JOIN, std::move(op.conditions), op.join_type,
                             op.estimated_cardinality),
      comparison_type(ExpressionType::INVALID) {
	// Convert the conditions partitions and sorts
	for (auto &cond : conditions) {
		D_ASSERT(cond.IsComparison());
		D_ASSERT(cond.GetLHS().GetReturnType() == cond.GetRHS().GetReturnType());
		join_key_types.push_back(cond.GetLHS().GetReturnType());
		const auto join_key_idx = join_key_types.size() - 1;

		auto left_cond = cond.LeftReference()->Copy();

实现与验收要点

迟到更正、补发、原触发事实与幂等规则。