Skip to content

Commit 6402967

Browse files
Remove extra indentation (#14886)
1 parent 757ab8c commit 6402967

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/elixir/pages/mix-and-otp/dynamic-supervisor.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ We have successfully learned how our supervision tree is automatically started (
1212
Supervisors know how to start processes because they are given "child specifications". In our `lib/kv.ex` file, we defined a list of children with a single child spec:
1313

1414
```elixir
15-
children = [
16-
{Registry, name: KV, keys: :unique}
17-
]
15+
children = [
16+
{Registry, name: KV, keys: :unique}
17+
]
1818
```
1919

2020
When the child specification is a tuple (as above) or module, then it is equivalent to calling the `child_spec/1` function on said module, which then returns the full specification. The pair above is equivalent to:
@@ -71,10 +71,10 @@ Given our buckets can already be supervised, it is time to hook them into our su
7171
Given our buckets can already be supervised, you may be thinking to start them as part of our application `start/2` callback, such as:
7272

7373
```elixir
74-
children = [
75-
{Registry, name: KV, keys: :unique}
76-
{KV.Bucket, name: {:via, Registry, {KV, "shopping"}}}
77-
]
74+
children = [
75+
{Registry, name: KV, keys: :unique}
76+
{KV.Bucket, name: {:via, Registry, {KV, "shopping"}}}
77+
]
7878
```
7979

8080
And while the above would definitely work, it comes with a huge caveat: it only starts a single bucket. In practice, we want the user to be able to create new buckets at any time. In other words, we need to start and supervise processes dynamically.

0 commit comments

Comments
 (0)