3 ms·
You can put a bound on the number of actors under a given supervisor. That being said the main reason an Erlang program will use an actor per request is not to
by ramchip 9y ago
You can put a bound on the number of actors under a given supervisor.
That being said the main reason an Erlang program will use an actor per request is not to prevent overload, it’s for fault tolerance; in your a -> b -> c -> d example a bug (e.g. uncaught exception) triggered by one request that happens in process c can cause all requests in flight to fail, while with a process per request there’s only one affected.
It does mean you may have thousands of actors rather than four or so, but that’s not a problem since Erlang is built and optimized for that kind of workload. On a platform where actors are OS threads, it may make sense to use a different approach.