THIS IS A DETAILED FEATURE REQUEST - Note: I have read the contributing guideline, and I am sure this issue is a "DETAILED feature requests". - Fact: Redis supported modules after 4.0 version. In the main function of server.c, modules are loaded before data:

```c
// server.c/main
moduleLoadFromQueue();
loadDataFromDisk();
```
  • Question: For what reason should modules be loaded before data?
  • Request: Can we add redis module a feature like post-bootstrap callback as @itamarhaber mentioned below, so that the module can do something to the data been loaded before redis server is fully up.

If there is a violation of the contributing rule, feel free to close this issue.

Comment From: itamarhaber

Hello @Choosue,

Modules can (but are not required to) declare custom data types. To load data that includes custom data types, the relevant module(s) must be loaded beforehand, so these types can be processed correctly.

It sounds to me like what you're actually asking for is a post-bootstrap callback to a module, correct?

Comment From: chushu10

@itamarhaber It is correct. So that means even if the module is loaded bofore the data from disk, we can still process the data when redis is starting up using a post-bootstrap callback?

I wanna know which document demonstrate this indetail. Thanks for your advice!

Regards, Chushu

Comment From: itamarhaber

AFAIK there is no such callback yet. You could open a feature request (i.e. this one) to discuss it.

I can see how such a callback could be useful, e.g. RedisModule_OnReady() or something, to signal a module that the dataset is loaded and the server is ready.

Comment From: itamarhaber

Now (v6) we have the ability to register to server events from modules, including loading from persistence - closing but feel free to reopen or create a new issue if deemed needed.