I am the author of the axiom
crate and I am working on the 0.1.0 release and I am trying to firm up the ergonomics and final API. I have a question for the readers here. What mechanism would they feel is the most comfortable and ergonomic way to create an actor that may have special config options.
Question of ergonomics. If you are spawning an actor which methodology would you prefer?
// Option 1: Multiple Methods
system.spawn(my_state, my_handler_func);
system.spawn_named("foo", my_state, my_handler_func);
system.spawn_with(ActorConfig{ name: Some("foo"), channel_size: 100 } my_state, my_handler_func);
// Option 2; Builder but no default `spawn` on the system.
system.actor().spawn(my_state, my_handler_func);
system.actor().name("Foo").spawn(my_state, my_handler_func);
system.actor().name("Foo").channel_size(100).spawn(my_state, my_handler_func);
This is purely an ergonomics question. In the first options it saves you a chained call in the simple state but in the second option its more fluid and expandable.
Opinions are welcome.