diff options
| author | yangwei <[email protected]> | 2024-11-25 19:23:01 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-11-25 19:23:01 +0800 |
| commit | ef5a65155b11fec8c6234f0a18678e11d7f79cf1 (patch) | |
| tree | e1f76e17711b5498e85cb3564e7e4251c81fbb1b /infra/module_manager/module_manager_interna.h | |
| parent | e2776414401af0bc02beb305b0d366fe3828cffd (diff) | |
🦄 refactor(module_manager ): new with hooks
Diffstat (limited to 'infra/module_manager/module_manager_interna.h')
| -rw-r--r-- | infra/module_manager/module_manager_interna.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/infra/module_manager/module_manager_interna.h b/infra/module_manager/module_manager_interna.h index 3e47bf0..08b285a 100644 --- a/infra/module_manager/module_manager_interna.h +++ b/infra/module_manager/module_manager_interna.h @@ -16,33 +16,35 @@ extern "C" struct module { char name[NAME_MAX]; - void *module_ctx; + void *ctx; }; -struct module_spec_load +struct module_descriptor { + struct module_hooks hooks; struct module *mod; - struct module_specification spec; - bool init_succ; + bool initialized; }__attribute__((aligned(sizeof(void*)))); struct module_manager { - char *module_spec_toml_path; - struct module_spec_load *module_specs; - int load_module_num; + struct module_descriptor *descriptors; + int n_descriptor; int topic_polling_id; struct { + char *toml_path; int max_thread_num; struct mq_schema *mq_schema; struct logger *logger; - }schema; + }config; }__attribute__((aligned(sizeof(void*)))); -void stellar_polling_dispatch(struct module_manager *mod_mgr); +struct module_manager *module_manager_new_with_toml(const char *toml_path, int max_thread_num, struct mq_schema *mq_schema, struct logger *logger); + +void module_manager_polling_dispatch(struct module_manager *mod_mgr); #ifdef __cplusplus } |
