cover/Elixir.Agent.Kind.Puppet.html| 1 | defmodule Agent.Kind.Puppet do |
|
| 2 | @behaviour Agent.Kind |
|
| 3 | import Agent.Session, only: [ask: 2, forward: 2] |
|
| 4 | |
|
| 5 | @impl true |
|
| 6 | def ask([{pid, %{kind: kind}}], _recipient, message) |
|
| 7 | when kind in [:headless, :puppet] do |
|
| 8 | :-( |
{:ok, response} = ask(pid, message) |
| 9 | :-( |
response |
| 10 | end |
|
| 11 | |
|
| 12 | @impl true |
|
| 13 | def forward([{pid, %{kind: kind}}], _recipient, message) |
|
| 14 | when kind in [:headless, :puppet] do |
|
| 15 | :-( |
forward(pid, message) |
| 16 | end |
|
| 17 | end |
|
| Line | Hits | Source |
|---|