# `Harlock.Sub`
[🔗](https://github.com/thatsme/harlock/blob/v0.2.0/lib/harlock/sub.ex#L1)

Subscriptions — long-running sources of events that the runtime starts and
stops as the model changes.

An app declares its active subscriptions via the optional `subs/1`
callback. The runtime diffs the returned list against what's currently
running on each render: new entries get started, removed entries get
stopped. The list is keyed by structural identity, so the same sub spec
returned twice produces only one running process.

v0.1 provides `Sub.interval/2`. Richer kinds (pubsub, file watchers,
signal handlers, websockets) arrive alongside the full Cmd executor.

# `t`

```elixir
@type t() :: {:interval, pos_integer(), any()}
```

# `interval`

```elixir
@spec interval(pos_integer(), any()) :: t()
```

Send `msg` to the runtime every `ms` milliseconds. The first fire happens
after `ms` ms, not immediately.

---

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