bastion-rs / bastion

Highly-available Distributed Fault-tolerant Runtime
https://www.bastion-rs.com
Apache License 2.0
2.78k stars 101 forks source link

Bikeshed the api traits / structs and function names #320

Open o0Ignition0o opened 3 years ago

o0Ignition0o commented 3 years ago

Since we're focused on polishing the APIs at the moment, it's a great time to try to find names for our APIs that fit.

The main names we could bikeshed can be Children / Child | Supervisor | Distributor | MessageHandler

Given the project name uses wording that can be found in a military / defense context, refering to Children as Platoon (or maybe a Squad / Crew ?) was suggested. A child could be a Trooper or so?

Any thoughts ? :)

vertexclique commented 3 years ago

At the time when this project first established, I wanted to use process pid for addressing async closures. Then onwards, I see that people wants to address content and it evolved to Akka's children model https://doc.akka.io/japi/akka/current/akka/actor/dungeon/Children.html

Then we can address multiple actors with asterisk under the same group like "supervisor::*" will give all the async closures run with lightprocs (which we call processes) to be addressable all at once. This doesn't exist in Erlang obviously but that's where we diverge to create a better usage. So then children was born into it's current form.

timClicks commented 3 years ago

Where possible, I would avoid using a plural for a struct name, e.g. Children. It creates mental friction for people learning the API because it leads to sentences that are grammatically incorrect, e.g. "a Children" and "two Children's"

vertexclique commented 3 years ago

I saw that too, we can get rid of that construct and leave redundancy to users directly in condition-controlled loops. I also don't like it in the current form, I agree.