* Document the behavior of async_stream_nolink
* Apply suggestions from code review
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
* Fix format
---------
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
Tasks were launched with proc_lib, which added
additional processing on boot. We removed the
proc_lib layer, which has the benefit of removing
the double logging (which only happened on tasks
but not any other behaviour).
This reduces memory usage and speeds up the most common
use case of Task.Supervisor. The scenario where Task.Supervisor
has a custom restart non-temporary strategy now is a bit slower
(it requires 2 GenServer calls), but this approach has been
deprecated for several releases already.
This functionality unfortunately disables the selective
receive optimizations. We will pursue making this simpler
in Erlang/OTP first.
This reverts commit a98a960f91.
A supervisor with that starts multiple partitions of the same child.
Certain processes may become bottlenecks in large systems.
If those processes can have their state trivially partitioned,
in a way there is no dependency between them, then they can use
the `PartitionSupervisor` to create multiple isolated and
independent partitions.
Once the `PartitionSupervisor` starts, you can dispatch to its
children using `{:via, PartitionSupervisor, {name, key}}`, where
`name` is the name of the `PartitionSupervisor` and key is used
for routing.
Task.Supervisor.async/* would copy the MFA to the supervisor
process. async_stream/* would additionally copy the value to
the stream coordinator. This commit makes it so those copies
are no longer necessary. The only unnecessary copy is in
Task.Supervisor.start_child/2 which we can't address due to
backwards compatibility.
When running Task.Supervised.stream/6 with ordered options turned off,
the "waiting" map to store the response from task is not cleaned up.
This leads to the response piled up in the map causing memory leak.
This changes cleanup the map of the response that has been delivered to the reducer
function.