# `Jidoka.Cancellation`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/cancellation.ex#L1)

Typed evidence that an asynchronous Jidoka request was cancelled.

Cancellation is request-scoped runtime data. It is not a turn snapshot and it
does not imply that an external side effect was rolled back.

# `t`

```elixir
@type t() :: %Jidoka.Cancellation{
  cancelled_at_ms: integer(),
  forced?: boolean(),
  reason: :cancelled,
  request_id: binary()
}
```

# `token`

```elixir
@opaque token()
```

Opaque request-scoped cancellation signal used by the runtime.

# `new`

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

Builds typed cancellation evidence.

# `new!`

```elixir
@spec new!(keyword() | map()) :: t()
```

Builds typed cancellation evidence or raises.

# `requested?`

```elixir
@spec requested?(Jidoka.Context.t() | token()) :: boolean()
```

Returns true when a runtime context or token has a cancellation request.

# `schema`

```elixir
@spec schema() :: Zoi.schema()
```

Returns the schema for typed cancellation evidence.

---

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