同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Related Modules:
Description:
Defines the subscriber for external interfaces to subsribe to events and data of a topic.
Subscribe )(IUnknown *iUnknown, const Topic *topic, Consumer *consumer) |
|
ModifyConsumer )(IUnknown *iUnknown, const Topic *topic, Consumer *old, Consumer *current) |
Consumer *(* |
Unsubscribe )(IUnknown *iUnknown, const Topic *topic, const Consumer *consumer) |
Consumer *(* |
int(* Subscriber::AddTopic) ([IUnknown](IUnknown.md) *iUnknown, const [Topic](Broadcast.md#gaf03f5bc94cad32ab628a6cdee09b0542) *topic)
Description:
Adds a specified topic to the Broadcast service.
The specified topic is added by the subscriber. A topic can be subscribed to only after being added.
Parameters:
iUnknown | Indicates external interface of the pub/sub feature. |
topic | Indicates the topic to be subscribed to. |
Returns:
Returns EC_SUCCESS if the topic is successfully added; returns other error codes if the topic fails to be added.
[Consumer](Consumer.md)*(* Subscriber::ModifyConsumer) ([IUnknown](IUnknown.md) *iUnknown, const [Topic](Broadcast.md#gaf03f5bc94cad32ab628a6cdee09b0542) *topic, [Consumer](Consumer.md) *old, [Consumer](Consumer.md) *current)
Description:
Modifies the consumer of a specified topic.
Parameters:
iUnknown | Indicates the pointer to the external interface of the pub/sub feature. |
topic | Indicates the pointer to the topic whose consumer will be modified. |
old | Indicates the pointer to the original consumer of the topic. |
current | Indicates the pointer to the new consumer of the topic. |
Returns:
Returns the pointer of the original consumer if the modification is successful; returns NULL otherwise.
int(* Subscriber::Subscribe) ([IUnknown](IUnknown.md) *iUnknown, const [Topic](Broadcast.md#gaf03f5bc94cad32ab628a6cdee09b0542) *topic, [Consumer](Consumer.md) *consumer)
Description:
Subscribes to a specified topic for consumers.
Call this function on the subscriber. The topic to be subscribed to must have been added to the Broadcast service.
Parameters:
iUnknown | Indicates external interface of the pub/sub feature. |
topic | Indicates the topic to be subscribed to. |
consumer | Indicates the consumer who subscribes to the topic. |
Returns:
Returns EC_SUCCESS if the subscription is successful; returns other error codes if the subscription fails.
[Consumer](Consumer.md)*(* Subscriber::Unsubscribe) ([IUnknown](IUnknown.md) *iUnknown, const [Topic](Broadcast.md#gaf03f5bc94cad32ab628a6cdee09b0542) *topic, const [Consumer](Consumer.md) *consumer)
Description:
Unsubscribes from a specified topic.
This function cancels the subscription relationship between the specified topic and consumer.
Parameters:
iUnknown | Indicates external interface of the pub/sub feature. This parameter is used to obtain subscription relationships. |
topic | Indicates the pointer to the topic to unsubscribe from. |
consumer | Indicates the pointer to the consumer. |
Returns:
Returns the pointer of the consumer if the unsubscription is successful; returns NULL otherwise.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。