# `Condukt.Signal`
[🔗](https://github.com/tuist/tuist/blob/condukt@3.0.0/condukt/lib/condukt/signal.ex#L1)

A kind of value delivered to a parked tool call from outside the session.

A signal kind is a module that checks the values sent under it, such as a CI
webhook's result or a person's answer. A tool parks on keys of a kind, and
the host delivers a value with `Condukt.signal/4`:

    defmodule MyApp.Signals.CiResult do
      @behaviour Condukt.Signal

      @impl true
      def cast(%{"status" => status, "log_url" => url}) when status in ["passed", "failed"],
        do: {:ok, %{status: status, log_url: url}}

      def cast(_value), do: {:error, :expected_status_and_log_url}
    end

`cast/1` runs in the process that delivers the signal, before the session
sees it. A value it rejects is answered `{:error, {:invalid, reason}}` and kept
nowhere. Keep values small: send a reference, such as a build id, for
anything large.

See the [Waiting for Events](parking.md) guide.

# `cast`

```elixir
@callback cast(value :: term()) :: {:ok, term()} | {:error, term()}
```

Checks and normalizes a delivered value.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
