gobj_unsubscribe_event()
#
Removes a subscription from a publisher to a subscriber for a specific event in the GObj system.
Prototype
int gobj_unsubscribe_event(
hgobj publisher,
gobj_event_t event,
json_t *kw,
hgobj subscriber
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The GObj acting as the publisher from which the subscription should be removed. |
|
|
The event name for which the subscription should be removed. |
|
|
A JSON object containing additional parameters for filtering the subscription removal. Owned by the function. |
|
|
The GObj acting as the subscriber that should be unsubscribed from the event. |
Return Value
Returns 0 on success, or -1 if the subscription was not found or an error occurred.
Notes
If the event
is not found in the publisher’s output event list, the function will return an error unless the publisher has the gcflag_no_check_output_events
flag set.
If multiple subscriptions match the given parameters, all of them will be removed.
If no matching subscription is found, an error is logged.
The function decrements the reference count of kw
before returning.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples