summaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@dashbit.co>2022-06-04 17:25:03 +0200
committerJosé Valim <jose.valim@dashbit.co>2022-06-04 17:25:10 +0200
commit878b2851e787371a2e6f52e78a9e1137e4f19c71 (patch)
treec92584b4f71686cfe0bcddbfa165d00f400b119a /CHANGELOG.md
parent5a3da8417b29ba5767819930926cbcb5dc0cc6a2 (diff)
downloadelixir-878b2851e787371a2e6f52e78a9e1137e4f19c71.tar.gz
Improvements to CHANGELOG
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md23
1 files changed, 12 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8952378aa..69ac7d3fc 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -55,25 +55,26 @@ back-pressure. You can use any term as the partitioning key.
### A Common Example
A common and practical example of a good use case for `PartitionSupervisor` is
-partitioning something like a `Task.Supervisor`. With many tasks under it, a
-task supervisor can be a bottleneck. Instead of starting a single
-`Task.Supervisor` for a set of tasks, you can start multiple ones:
+partitioning something like a `DynamicSupervisor`. When starting many processes
+under it, a dynamic supervisor can be a bottleneck, especially if said processes
+take long to initialize. Instead of starting a single `DynamicSupervisor`,
+you can start multiple ones:
```elixir
children = [
- {PartitionSupervisor, child_spec: Task.Supervisor, name: MyApp.TaskSupervisors}
+ {PartitionSupervisor, child_spec: DynamicSupervisor, name: MyApp.DynamicSupervisors}
]
Supervisor.start_link(children, strategy: :one_for_one)
```
-Now you start tasks on the task supervisor for the right partition. For
-instance, you can partition by PID, like in the previous example:
+Now you start processes on the dynamic supervisor for the right partition.
+For instance, you can partition by PID, like in the previous example:
```elixir
-Task.Supervisor.async(
- {:via, PartitionSupervisor, {MyApp.TaskSupervisors, self()}},
- fn -> :do_some_work end
+DynamicSupervisor.start_child(
+ {:via, PartitionSupervisor, {MyApp.DynamicSupervisors, self()}},
+ my_child_specification
)
```
@@ -101,8 +102,8 @@ int = 1
bin = "foo"
int <> bin
#=> ** (ArgumentError) construction of binary failed:
-#=> segment 1 of type 'binary':
-#=> expected a binary but got: 1
+#=> segment 1 of type 'binary':
+#=> expected a binary but got: 1
```
## Slicing with steps