Files
XCSDD/docs/api/core/event/ProcessUnsubscribes.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

765 B

Event::ProcessUnsubscribes

void ProcessUnsubscribes();

处理积压的退订请求。

描述

手动处理待退订的回调,将其从订阅列表中移除。通常不需要手动调用,Invoke 会自动处理退订。但在某些场景下可能需要主动调用。

复杂度: O(n) 其中 n 为待退订数量

示例:

#include <XCEngine/Core/Event.h>

using namespace XCEngine::Core;

Event<int> event;

// 订阅
uint64_t id = event.Subscribe([](int value) { });

// 退订请求入队
event.Unsubscribe(id);

// 主动处理退订
event.ProcessUnsubscribes();

// 此时事件列表中已无该回调

相关文档