# `Tinyeval`
[🔗](https://github.com/evalship-hq/tinyeval/blob/main/lib/tinyeval.ex#L1)

A worker for [tinyeval](https://tinyeval.com): your app starts once and answers every test case.

    # evals/worker.exs, started by `worker mix run --no-start evals/worker.exs`
    Tinyeval.worker(fn input -> MyApp.Support.answer(input) end)

See the README for the rest.

# `worker`

```elixir
@spec worker((String.t() -&gt; String.t())) :: :ok
```

Answers each input tinyeval sends with `answer.(input)`, until tinyeval is done.

It first points stdout at stderr, so output from your app can't mix with the replies, then
starts your app when Mix is running. Start the worker with `mix run --no-start`, so your app
starts after that. `Tinyeval.CouldntRun` marks the run as couldn't run, and any other error
becomes the reply, so the eval fails.

---

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