# `Minga.Extension.Instance.Worker`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga/extension/instance/worker.ex#L1)

Linked, monitored, bounded transition work owned by one Instance.

# `failure`

```elixir
@type failure() ::
  {:transition_worker_failed, kind(),
   {:raise, Exception.t(), Exception.stacktrace()}
   | {:throw | :exit, term(), Exception.stacktrace()}}
```

# `kind`

```elixir
@type kind() :: :start | :terminate | {:finalizer, atom()} | :cleanup
```

Identity and cancellation handles for one asynchronous transition.

# `t`

```elixir
@type t() :: %Minga.Extension.Instance.Worker{
  id: reference(),
  kind: kind(),
  monitor: reference(),
  pid: pid(),
  timer: reference()
}
```

# `cancel`

```elixir
@spec cancel(t()) :: :ok
```

Cancels work whose transition lost lifecycle authority.

# `complete`

```elixir
@spec complete(t()) :: :ok
```

Cancels timeout/monitor bookkeeping after a matching completion.

# `down`

```elixir
@spec down(t()) :: :ok
```

Clears timer bookkeeping after a worker DOWN.

# `start`

```elixir
@spec start(pid(), kind(), pos_integer(), (-&gt; term())) :: t()
```

Starts linked transition work and arms its deterministic timeout.

# `start`

```elixir
@spec start(pid(), kind(), pos_integer(), reference(), (-&gt; term())) :: t()
```

Starts transition work with a caller-owned identity for progress messages.

# `timeout`

```elixir
@spec timeout(t()) :: :ok
```

Kills work which exceeded its authority-owned deadline.

---

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