# `Mojentic.Realtime.Transport`
[🔗](https://github.com/svetzal/mojentic-ex/blob/v1.5.0/lib/mojentic/realtime/transport.ex#L1)

Transport behaviour for the realtime subsystem.

The gateway owns I/O against this contract so unit tests can replace
the live WebSocket with a scripted, deterministic transport.
Production implementation: `Mojentic.Realtime.MintTransport`.

# `close`

```elixir
@callback close(pid()) :: :ok
```

# `connect`

```elixir
@callback connect(
  url :: String.t(),
  headers :: [{String.t(), String.t()}],
  opts :: keyword()
) ::
  {:ok, pid()} | {:error, term()}
```

# `send`

```elixir
@callback send(pid(), payload :: map()) :: :ok | {:error, term()}
```

# `subscribe`

```elixir
@callback subscribe(pid(), subscriber :: pid()) :: :ok
```

---

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