Event queue for passing events between threads.
More...
|
enum | nugu_equeue_type {
NUGU_EQUEUE_TYPE_NEW_DIRECTIVE = 0
, NUGU_EQUEUE_TYPE_NEW_ATTACHMENT
, NUGU_EQUEUE_TYPE_INVALID_TOKEN
, NUGU_EQUEUE_TYPE_SEND_PING_FAILED
,
NUGU_EQUEUE_TYPE_EVENT_SEND_RESULT
, NUGU_EQUEUE_TYPE_EVENT_RESPONSE
, NUGU_EQUEUE_TYPE_REGISTRY_HEALTH
, NUGU_EQUEUE_TYPE_REGISTRY_SERVERS
,
NUGU_EQUEUE_TYPE_REGISTRY_FAILED
, NUGU_EQUEUE_TYPE_SERVER_CONNECTED
, NUGU_EQUEUE_TYPE_SERVER_DISCONNECTED
, NUGU_EQUEUE_TYPE_DIRECTIVES_CLOSED
,
NUGU_EQUEUE_TYPE_MAX = 255
} |
| event types More...
|
|
Event queue for passing events between threads.
Queue for raising event callbacks with passing data from another thread to the thread context in which GMainloop runs.
Manage the queue thread-safely using GAsyncQueue and wakeup the GMainloop using eventfd.
◆ nugu_equeue_type
event types
Enumerator |
---|
NUGU_EQUEUE_TYPE_NEW_DIRECTIVE | received new directive
|
NUGU_EQUEUE_TYPE_NEW_ATTACHMENT | received new attachment
|
NUGU_EQUEUE_TYPE_INVALID_TOKEN | received invalid token response
|
NUGU_EQUEUE_TYPE_SEND_PING_FAILED | failed to send ping request
|
NUGU_EQUEUE_TYPE_EVENT_SEND_RESULT | result of event sent
|
NUGU_EQUEUE_TYPE_EVENT_RESPONSE | directive response of event request
|
NUGU_EQUEUE_TYPE_REGISTRY_HEALTH | received health check policy
|
NUGU_EQUEUE_TYPE_REGISTRY_SERVERS | received server list
|
NUGU_EQUEUE_TYPE_REGISTRY_FAILED | failed to connect device-gateway-registry
|
NUGU_EQUEUE_TYPE_SERVER_CONNECTED | connected to server
|
NUGU_EQUEUE_TYPE_SERVER_DISCONNECTED | disconnected from server
|
NUGU_EQUEUE_TYPE_DIRECTIVES_CLOSED | directives stream closed by server
|
NUGU_EQUEUE_TYPE_MAX | maximum value for type id
|
◆ nugu_equeue_initialize()
NUGU_API int nugu_equeue_initialize |
( |
void |
| ) |
|
Initialize the event queue.
- Returns
- result
- Return values
-
◆ nugu_equeue_set_handler()
Set handler for event type.
- Parameters
-
[in] | type | type-id |
[in] | callback | callback function |
[in] | destroy_callback | destroy notifier function |
[in] | userdata | data to pass to the user callback |
- Returns
- result
- Return values
-
◆ nugu_equeue_unset_handler()
Unset handler for event type.
- Parameters
-
- Returns
- result
- Return values
-
◆ nugu_equeue_push()
Push new event with data to queue and trigger event callback in GMainloop thread context.
- Parameters
-
[in] | type | type-id |
[in] | data | event data |
- Returns
- result
- Return values
-