# `PhoenixMicro.Transport.Memory`
[🔗](https://github.com/iamkanishka/phoenix_micro/blob/v1.0.0/lib/phoenix_micro/transport/memory.ex#L1)

An in-process pub/sub transport backed by `Registry` and `GenServer`.

This transport is:
- **Always available** — no external broker required.
- **Used in test environments** to avoid broker dependencies.
- **Fully functional** — supports publish, subscribe, ack, nack, wildcard topics,
  consumer groups, and dead-letter queues.
- **Observable** — emits all standard Telemetry events.

## Wildcard support

Wildcards follow the NATS convention:
- `*` matches a single token: `"payments.*"` matches `"payments.created"`.
- `>` matches the rest: `"payments.>"` matches `"payments.created.v2"`.

## Usage in config

    config :phoenix_micro, transport: :memory

## Usage in tests

    setup do
      {:ok, _pid} = start_supervised(PhoenixMicro.Transport.Memory)
      :ok
    end

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `clear`

Clears the message log. Useful between test cases.

# `dlq_messages`

Returns all dead-lettered messages.

# `messages`

Returns all messages published since start (useful in tests).

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

# `wait_for_messages`

```elixir
@spec wait_for_messages(String.t(), pos_integer(), timeout()) :: :ok | :timeout
```

Blocks until at least `count` messages matching `topic` have been received.

---

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