# `Storehouse.Tus`
[🔗](https://github.com/hattoriai/storehouse/blob/v0.2.0/lib/storehouse/tus.ex#L1)

The uploads in progress of `Storehouse.Tus.Plug`: their state, kept in
ETS by this process, and those that expired, given up every
`:sweep_every` seconds (their parts deleted from the store).

    # lib/my_app/application.ex
    children = [
      MyApp.Repo,
      Storehouse.Tus,
      MyAppWeb.Endpoint
    ]

ETS is one node's: on several nodes behind a load balancer, a client's
next request can reach another, which does not know its upload. There,
keep the state in the app's database instead, with a module of
`Storehouse.Tus.State` given to the plug as `state:`.

## Options

  * `:sweep_every` - in seconds. The default is an hour.

# `start_link`

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

Starts the process, which owns the table of uploads.

# `sweep`

```elixir
@spec sweep(module(), keyword()) :: {:ok, non_neg_integer()}
```

Gives up the uploads of `state` that expired: `{:ok, count}`. The
process does it every `:sweep_every` seconds, with its own state.

---

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