

终止支持通知：2026 年 5 月 20 日， AWS 将终止对的支持。 AWS SimSpace Weaver 2026 年 5 月 20 日之后，您将无法再访问 SimSpace Weaver 控制台或 SimSpace Weaver 资源。有关更多信息，请参阅[AWS SimSpace Weaver 终止支持](https://docs.aws.amazon.com/simspaceweaver/latest/userguide/simspaceweaver-end-of-support.html)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# AllSubscriptionEvents 以及 OwnershipChanges 包含上次通话中的事件
<a name="working-with_app-sdk_misc_events-from-last-call"></a>

对 `Api::AllSubscriptionEvents()` 和 `Api::OwnershipChanges()` 的调用的返回值包含上一个调用（**不是上一个刻度**）的事件。在以下示例中，`secondSubscriptionEvents` 和 `secondOwnershipChangeList` 为空，因为它们的函数会在第一个调用后立即调用。

如果您等待 10 个刻度，然后调用 `Api::AllSubscriptionEvents()` 和 `Api::OwnershipChanges()`，则它们的结果将既包含事件又包含最近 10 个刻度（不是最后一个刻度）内的变化。

**Example 示例**  

```
Result<void> ProcessOwnershipChanges(Transaction& transaction)
{
    WEAVERRUNTIME_TRY(
        Api::SubscriptionChangeList firstSubscriptionEvents,
        Api::AllSubscriptionEvents(transaction));
    WEAVERRUNTIME_TRY(
        Api::OwnershipChangeList firstOwnershipChangeList,
        Api::OwnershipChanges(transaction));
    
    WEAVERRUNTIME_TRY(
        Api::SubscriptionChangeList secondSubscriptionEvents,
        Api::AllSubscriptionEvents(transaction));
    WEAVERRUNTIME_TRY(
        Api::OwnershipChangeList secondOwnershipChangeList,
        Api::OwnershipChanges(transaction));
    
    /**
     * secondSubscriptionEvents and secondOwnershipChangeList are 
     * both empty because there are no changes since the last call.
     */
}
```

**注意**  
函数 `AllSubscriptionEvents()` 已实施，但函数 `SubscriptionEvents()` **未实施**。