# `Bonny.Server.AsyncStreamRunner`
[🔗](https://github.com/coryodaniel/bonny/blob/v1.5.0/lib/bonny/server/async_stream_runner.ex#L1)

Runs the given stream in a separate process. Prepare your stream and add this Runner to your supervision tree
in order to control it (e.g. restart after the stream ends).

## Example
    # prepare a stream
    stream =
      conn
      |> K8s.Client.stream(operation)
      |> Stream.filter(&filter_resources/1)
      |> Stream.map(&process_stream/1)

    children = [
      {Bonny.Server.AsyncStreamRunner,
         name: ReconcileServer,
         stream: stream,
         termination_delay: 30_000,
    ]

    Supervisor.init(children, strategy: :one_for_one)

## Options

  * `:stream` - The (prepared) stream to run
  * `:name` (optional) - Register this process under the given name.
  * `:termination_delay` (optional) - After the stream ends, how many
    milliseconds to wait before the process terminates (and might be
    restarted by the Supervisor). Per default there's no delay

# `child_spec`

```elixir
@spec child_spec(keyword()) :: Supervisor.child_spec()
```

# `run`

```elixir
@spec run(Enumerable.t(), non_neg_integer()) :: no_return()
```

# `start_link`

```elixir
@spec start_link(keyword()) :: {:ok, pid()}
```

---

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