Skip to content

Commit

Permalink
Replace "dict" with "map" in Agents documentation page (#13874)
Browse files Browse the repository at this point in the history
Dictionary is deprecated as per the documentation, and the example is using Map module.
  • Loading branch information
omarodeh95 authored Oct 2, 2024
1 parent e2556fd commit 6152ecb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/elixir/pages/mix-and-otp/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ Before we move on to the next chapter, let's discuss the client/server dichotomy

```elixir
def delete(bucket, key) do
Agent.get_and_update(bucket, fn dict ->
Map.pop(dict, key)
Agent.get_and_update(bucket, fn map ->
Map.pop(map, key)
end)
end
```
Expand All @@ -200,9 +200,9 @@ This distinction is important. If there are expensive actions to be done, you mu
```elixir
def delete(bucket, key) do
Process.sleep(1000) # puts client to sleep
Agent.get_and_update(bucket, fn dict ->
Agent.get_and_update(bucket, fn map ->
Process.sleep(1000) # puts server to sleep
Map.pop(dict, key)
Map.pop(map, key)
end)
end
```
Expand Down

0 comments on commit 6152ecb

Please sign in to comment.