# `AppBlockList.Queue`
[🔗](https://github.com/explainableaixai/appblocklist-elixir/blob/v1.0.0/lib/appblocklist/queue.ex#L1)

A GenServer that owns one client and sends lookups one at a time.

Every caller in your application goes through the same process, so the
service sees an ordered stream of requests with at least `:interval`
milliseconds between them, no matter how many LiveViews, Oban jobs or
Broadway stages ask at once. Answers (including not-found answers) are
cached for `:ttl` milliseconds.

    children = [
      {AppBlockList.Queue, interval: 150, ttl: :timer.hours(24)}
    ]

    {:ok, app} = AppBlockList.Queue.lookup("com.zhiliaoapp.musically")

Options: `:name` (default `AppBlockList.Queue`), `:interval` (ms, default
100), `:ttl` (ms, default 24 hours), `:client` (an `AppBlockList.Client`;
default `AppBlockList.Client.new()` at start), any other option is passed
to `AppBlockList.Client.new/1`.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `clear_cache`

Drops every cached answer.

# `lookup`

```elixir
@spec lookup(GenServer.server(), String.t(), timeout()) ::
  {:ok, AppBlockList.App.t()} | {:error, AppBlockList.Error.t()}
```

Looks up an ID through the queue. Same return values as `AppBlockList.Client.lookup/2`.

# `start_link`

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

---

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