# `BroadwaySQS.SQSClient`
[🔗](https://github.com/dashbitco/broadway_sqs/blob/v1.0.1/lib/broadway_sqs/sqs_client.ex#L1)

A generic behaviour to implement SQS Clients for `BroadwaySQS.Producer`.

This module defines callbacks to normalize options and receive message
from a SQS queue. Modules that implement this behaviour should be passed
as the `:sqs_client` option from `BroadwaySQS.Producer`.

# `messages`

```elixir
@type messages() :: [Broadway.Message.t()]
```

# `init`

```elixir
@callback init(opts :: any()) ::
  {:ok, normalized_opts :: any()} | {:error, reason :: binary()}
```

Should initialize the SQS client.

This callback is called when the producer is started. It should return
`{:ok, normalized_opts}` if the client was initialized successfully or
`{:error, reason}` if there was an error. `normalized_opts` is what gets
passed to the `c:receive_messages/2` callback.

# `receive_messages`

```elixir
@callback receive_messages(demand :: pos_integer(), opts :: any()) :: messages()
```

Should fetch messages from the configured SQS queue.

`opts` is the normalized options returned from `c:init/1`. The `demand`
argument is the number of messages that the producer is asking for.

---

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