envato / event_sourcery

A library for building event sourced applications in Ruby
MIT License
84 stars 10 forks source link

Add event stream processor registry #40

Closed stevehodgkiss closed 8 years ago

stevehodgkiss commented 8 years ago

Automatic registration of ESP's to EventSourcery.event_stream_processor_registry and lookup via :

Would EventSourcery.esp_registry be better/more concise?

This will be used to select what ESP's to run.

vonconrad commented 8 years ago

Love your work @stevehodgkiss! Raised a question about the registry class, otherwise 👍

stevehodgkiss commented 8 years ago

Thanks @vonconrad. Added some filter methods so that you can select registry.projectors and registry.event_reactors. In the future we could add tagging to ESP's and add methods to filter by tag here like registry.tagged('tax').

grassdog commented 8 years ago

:+1: Looks good.

grassdog commented 8 years ago

A few more thoughts. So this will work within process but we'd likely want something like this that runs across processes. Any thoughts on how we achieve that?

stevehodgkiss commented 8 years ago

Good question @grassdog. When we do the work to integrate a "supervisor" that runs multiple ESP's then we'd need to take this into account then... not sure how we could account for it right now when it doesn't exist. I think when we introduce a supervisor object then ESP's would be registered at load time anyways (with no multi threaded components at that stage), so I don't think many modifications would be needed.

grassdog commented 8 years ago

Yeah, I don't think it blocks this PR necessarily. I do feel there is some supervision orchestration piece outstanding. As mentioned on Slack one strategy here could be to use threads under a single process. Another might be via something like ECS.