pulsar icon indicating copy to clipboard operation
pulsar copied to clipboard

157-Make-module-apis-more-ergonomic

Open azenna opened this issue 2 years ago • 2 comments

Make module api more erogonomic

Use a module trait to build interface for pulsar modules

Implementation

Should be working, definitely needs some cleanup though

I have

  • [x] run cargo fmt;
  • [x] run cargo clippy;
  • [x] run cargo testand all tests pass;
  • [x] linked to the originating issue (if applicable).

resolves #157

azenna avatar Sep 21 '23 08:09 azenna

hi, sorry it took me a long time to think about the original issue. It's not a simple problem because it's a complete refactoring of all the internals and there are a lot of things to think about before going to the development.

I have seen your pr and there are few wrong things, for example there are both the Module trait and the PulsarModule struct.

Another example is the _ = rx_config.changed() => {...} branch in the tokio:select! of module.rs, it's used to check if the configuration changed but modules need to parse the configuration themselves in their on_change function.

Or yet another example is that the bus receiver is always allocated in module.rs, even for for modules that don't use it.

Apart from that, we have discussed internally and there are other upcoming changes we have in the pipeline (for example changes to the configuration format and to the threat response, etc). So we need a deeper refactoring to address all these needs.

I will update the issue in the next days with other details.

Feel free to join the discussion. Thanks

banditopazzo avatar Sep 26 '23 12:09 banditopazzo

heyy, yeah completely understand! I'll work on addressing your feedback in this pr over the next couple of days. Mostly just wanted to work on this to see more of the project and learn new things. Let me where the PR needs to move and I'll work on it!

azenna avatar Sep 26 '23 13:09 azenna