eventide-project / consumer-postgres

Event Sourcing and Microservices Stack for Ruby
http://eventide-project.org
MIT License
2 stars 0 forks source link

Consumers start, read, and terminate when not run in an actor supervisor #5

Open sbellware opened 5 years ago

sbellware commented 5 years ago

Presently, consumers immediately terminate when an actor supervisor (https://github.com/ntl/actor) is not present and active.

This is largely a contravention of the principle of least surprise. Starting a consumer is not expected to result in a consumer terminating after one cycle.

Alternatively, terminate the consumer with an error if an actor supervisor is not present.

Challenges: The implication for design is that the actor is injected into the consumer. Presently, such a design is not in-place, and may not be entirely feasible per the necessary design of the actor library.

Per @ntl: A change should be made to the actor library to start the actor in a new supervisor if the actor has not been added to a supervisor.

Coming additions to Ruby's fiber model may make this work more straight forward, and this item may be deferred until then.

sbellware commented 5 years ago

Defer this until the state of upcoming changes to Ruby are known. Fibers might offer a better solution to the message passing between actors. Keep an eye on "auto-switching".