# `Arc.Subscription`
[🔗](https://github.com/Cratis/Arc.Elixir/blob/main/lib/arc/subscription.ex#L4)

One live subscription to an observable query.

A subscription is a process under the application's dynamic supervisor. It runs the query,
sends the owner `{:arc_query_result, id, %Arc.QueryResult{}}`, and sends another every time a
watched read model changes or a topic is notified. It monitors the owner and ends with it.

It uses `restart: :temporary`: a failing subscription ends instead of restarting and failing
again in a loop; the client resubscribes.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start`

```elixir
@spec start(module(), map()) :: {:ok, pid()} | {:error, term()}
```

Starts a subscription. `spec` is a map with `:owner`, `:id`, `:descriptor`, `:query`, `:args`,
`:ctx` and `:opts`. Requires the application to be started.

# `stop`

```elixir
@spec stop(pid()) :: :ok
```

Stops a subscription.

---

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