本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
AllSubscriptionEvents並OwnershipChanges包含來自上次呼叫的事件
呼叫的傳回值,Api::AllSubscriptionEvents()
並Api::OwnershipChanges()
包含來自上次呼叫的事件,而不是最後一次呼叫。在下列範例中,secondSubscriptionEvents
且secondOwnershipChangeList
是空的,因為它們的函數會在第一次呼叫之後立即呼叫。
如果您等待 10 個刻度,然後調用Api::AllSubscriptionEvents()
和Api::OwnershipChanges()
,它們的結果將包含事件和來自最後 10 個刻度(不是最後一個刻度)的更改。
範例
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()
未實現。