

終止支援通知： 將於 2026 AWS 年 5 月 20 日結束對 的支援 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()`**未實作**。