diff options
| author | yangwei <[email protected]> | 2024-09-25 17:44:27 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-09-25 17:44:27 +0800 |
| commit | 7291db59693c271f582cc5428306d74a007cb4b9 (patch) | |
| tree | f29e8965d94e674373b58ba6082e0117bae9e379 /include | |
| parent | c550acef84ee54915518f776a179901d94d481f4 (diff) | |
✨ feat(module manager): Define and implement the polling API
Diffstat (limited to 'include')
| -rw-r--r-- | include/stellar/module_manager.h | 5 | ||||
| -rw-r--r-- | include/stellar/stellar.h | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/include/stellar/module_manager.h b/include/stellar/module_manager.h index 06c51a4..7d99bec 100644 --- a/include/stellar/module_manager.h +++ b/include/stellar/module_manager.h @@ -37,6 +37,11 @@ int stellar_module_manager_get_max_thread_num(struct stellar_module_manager* mod const char *stellar_module_manager_get_toml_path(struct stellar_module_manager *mod_mgr); struct mq_schema *stellar_module_manager_get_mq_schema(struct stellar_module_manager *mod_mgr); +typedef void module_on_polling_func(struct stellar_module_manager* mod_mgr, void *polling_arg); +//return 0 if success, otherwise return -1. +int stellar_module_manager_polling_subscribe(struct stellar_module_manager* mod_mgr, module_on_polling_func on_polling, void *polling_arg); +void stellar_module_manager_polling_dispatch(struct stellar_module_manager *mod_mgr); +void stellar_module_manager_polling_active(struct stellar_module_manager *mod_mgr); #ifdef __cplusplus } diff --git a/include/stellar/stellar.h b/include/stellar/stellar.h index a2b6f28..e03b791 100644 --- a/include/stellar/stellar.h +++ b/include/stellar/stellar.h @@ -18,11 +18,6 @@ typedef void plugin_on_packet_func(struct packet *pkt, void *on_packet_cb_arg); //return 0 if success, otherwise return -1. int stellar_raw_packet_subscribe(struct stellar *st, plugin_on_packet_func *on_packet_cb, void *on_packet_cb_arg); -//return on_polling state, 0: idle, 1: working -typedef int plugin_on_polling_func(void *polling_arg); -//return 0 if success, otherwise return -1. -int stellar_polling_subscribe(struct stellar *st, plugin_on_polling_func on_polling, void *polling_arg); - void stellar_emit_datapath_telemetry(struct packet *pkt, const char * module, const char *str); // only send user build packet, can't send packet which come from network |
