cover/Elixir.Agent.Kind.Native.html| 1 | defmodule Agent.Kind.Native do |
|
| 2 | @behaviour Agent.Kind |
|
| 3 | import String, only: [to_atom: 1] |
|
| 4 | import Elita, only: [request: 2, dispatch: 2] |
|
| 5 | |
|
| 6 | @impl true |
|
| 7 | def ask([{_pid, %{kind: :native}}], recipient, message) do |
|
| 8 | 17 | request(to_atom(recipient), message) |
| 9 | end |
|
| 10 | |
|
| 11 | @impl true |
|
| 12 | def forward([{_pid, %{kind: :native}}], recipient, message) do |
|
| 13 | 31 | dispatch(to_atom(recipient), message) |
| 14 | end |
|
| 15 | end |
|
| Line | Hits | Source |
|---|