Skip to content

Commit a590679

Browse files
Apply suggestions from code review
Co-authored-by: Rodolfo Carvalho <[email protected]>
1 parent 4ca0383 commit a590679

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GET shopping milk
1919
OK
2020
```
2121

22-
In the example session above we interacted with the "shopping" bucket. Therefore, an important feature in our key-value store to add names to processes.
22+
In the example session above we interacted with the "shopping" bucket by referencing its name. Therefore, an important feature in our key-value store is to give names to processes.
2323

2424
We have also learned in the previous chapter we can already name our buckets. For example:
2525

@@ -53,7 +53,7 @@ iex> KV.Bucket.get(name, "milk")
5353
1
5454
```
5555

56-
As you can see, instead of passing an atom to the `:name` option, we pass a tuple of shape `{:via, registry_module, {registry_name, process_name}}`, and everything just worked. You could have used anything as the `process_name`, even an integer or a map! That's because all of Elixir built-in behaviours, agents, supervisors, tasks, etc. are compatible with naming registries, as long as you pass them using the "via" tuple format.
56+
As you can see, instead of passing an atom to the `:name` option, we pass a tuple of shape `{:via, registry_module, {registry_name, process_name}}`, and everything just worked. You could have used anything as the `process_name`, even an integer or a map! That's because all of Elixir built-in behaviours, agents, supervisors, tasks, etc, are compatible with naming registries, as long as you pass them using the "via" tuple format.
5757

5858
Therefore, all we need to do to name our buckets is to start a `Registry`, using `Registry.start_link/1`. But you may be wondering, where exactly should we place that?
5959

0 commit comments

Comments
 (0)