diff options
| author | yangwei <[email protected]> | 2024-09-25 18:18:02 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-09-25 18:18:02 +0800 |
| commit | 74f77f34112170d081868203441e71b2c78a5452 (patch) | |
| tree | 7134993b9f9013d620777e03f8727648c79e404b /include | |
| parent | 7291db59693c271f582cc5428306d74a007cb4b9 (diff) | |
✨ feat(polling manager): support polling manager
Diffstat (limited to 'include')
| -rw-r--r-- | include/stellar/module_manager.h | 6 | ||||
| -rw-r--r-- | include/stellar/polling_manager.h | 21 |
2 files changed, 22 insertions, 5 deletions
diff --git a/include/stellar/module_manager.h b/include/stellar/module_manager.h index 7d99bec..283e948 100644 --- a/include/stellar/module_manager.h +++ b/include/stellar/module_manager.h @@ -37,11 +37,7 @@ 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/polling_manager.h b/include/stellar/polling_manager.h new file mode 100644 index 0000000..641c03e --- /dev/null +++ b/include/stellar/polling_manager.h @@ -0,0 +1,21 @@ +#pragma once + +#ifdef __cplusplus +extern "C" +{ +#endif + +#include "stellar/module_manager.h" + +struct stellar_polling_manager; + +struct stellar_polling_manager *stellar_module_get_polling_manager(struct stellar_module_manager *mod_mgr); + +typedef void module_on_polling_func(struct stellar_polling_manager* mod_mgr, void *polling_arg); +//return 0 if success, otherwise return -1. +int stellar_polling_subscribe(struct stellar_polling_manager* mod_mgr, module_on_polling_func on_polling, void *polling_arg); +void stellar_polling_active(struct stellar_polling_manager *mod_mgr); + +#ifdef __cplusplus +} +#endif
\ No newline at end of file |
