Closed falood closed 6 years ago
What are the advantages/disadvantages of doing this?
Allowing for composite servers could allow developers to scale individual workers for servers a lot more efficient (when leveraging the supervisor/worker model).
I use maru on my own production, we have 4 http servers run on the same node, most advantages are for this use case.
Application.start :maru
, it can't resolve depends issue, we may need to start by custom order.Maru.Type
bind to service, then we don't need to define Maru.Type.UserID
for all services, we may need to define MyService.Types.UserID
and import_type MyServices.Types
in the server module.plugin
, we may use different plugin in different services.root_plug
in current version, it's a bad design, I think everything belongs to root_plug
can be moved to server module.No Disadvantages, I think everything is better.
Okay. I took some time to think over this. This would make Maru more portable and flexible to process control. I'm down for this.
What are some roadblocks that are visible right now? Outside of tests and sample code to make sure it works, that is.
Nothing, I'm still thinging about how to migrate smooth.
I have had https://github.com/elixir-maru/maru/pull/108 for this issue.
for now, we still need make_plug: true
as options of use Maru.Router
, will keep working on building plug in server module.
something like Ecto and other apps, use a standalone module to run server, mount server to it's own supervisor tree.
and then add
worker(MyServer, [])
to supervisor tree.