# `JoobQ.Context`
[🔗](https://github.com/azutoolkit/joobqui/tree/master/sdks/elixir/blob/main/lib/joobq/context.ex#L2)

The request context of the job a handler runs, carried on to the work it starts. Inside `perform/1` (and its
middleware), `JoobQ.enqueue/4`, `enqueue_async/4`, `enqueue_many/2`, `create_batch/2` and `start_workflow/3` lay
the running job's context (`job.context`: `tenant_id`, `request_id`, `traceparent`, ...) under the context you
give them, whose keys win, as every SDK's `ctx.enqueue`, `ctx.start` and `ctx.create_batch` do. Keys are strings
(an atom key is turned into its string).

It lives in the handler's own process: a process it starts has none, so pass `context: job.context` there.

# `current`

```elixir
@spec current() :: map()
```

The context of the job this process runs, `%{}` outside a handler.

# `merge`

```elixir
@spec merge(term(), term()) :: term()
```

`own` laid over `base`, both with string keys. An `own` that is not a map, or a struct on either side, is answered
as it is, never walked: it goes on to the body, which the gateway's JSON encoding refuses by its kind only.

---

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