# `Celery.Worker.Request`
[🔗](https://github.com/hacktobeer/celery-elixir/blob/v0.1.0/lib/celery/worker/request.ex#L1)

Worker task request wrapper (ported from `celery.worker.request.Request`).

Wraps a decoded `%Celery.Task.Context{}` and its underlying `%Kombu.Message{}`
to manage message acknowledgement (`acks_late`), rejection, expiration, and
inspection metadata.

# `t`

```elixir
@type t() :: %Celery.Worker.Request{
  acknowledged: boolean(),
  context: Celery.Task.Context.t(),
  hostname: String.t(),
  id: String.t(),
  message: Kombu.Message.t() | nil,
  name: String.t(),
  time_start: float() | nil,
  worker_pid: pid() | nil
}
```

# `acknowledge`

```elixir
@spec acknowledge(t()) :: {t(), :ok | {:error, term()}}
```

Acknowledges the underlying `%Kombu.Message{}` if not already acknowledged.

# `from_message`

```elixir
@spec from_message(Kombu.Message.t(), String.t()) :: {:ok, t()} | {:error, term()}
```

Creates a `%Celery.Worker.Request{}` from a `%Kombu.Message{}` and worker `hostname`.

# `info`

```elixir
@spec info(t()) :: map()
```

Returns an inspection dictionary matching Python Celery's `Request.info()`.

# `reject`

```elixir
@spec reject(t(), keyword()) :: {t(), :ok | {:error, term()}}
```

Rejects the underlying `%Kombu.Message{}` (with `requeue: boolean()`).

---

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