# `Aerospike.RegisterTask`
[🔗](https://github.com/luisgabrielroldan/aerospike_driver/blob/v0.3.1/lib/aerospike/register_task.ex#L1)

Tracks UDF package registration progress across the currently active cluster nodes.

`Aerospike.register_udf/3` and `register_udf/4` return this handle after the
server accepts the upload. The package may still be propagating when the
call returns, so use `status/1` or `wait/2` before relying on it from
`apply_udf/6`, query UDFs, or other package consumers.

# `t`

```elixir
@type t() :: %Aerospike.RegisterTask{
  conn: Aerospike.cluster(),
  package_name: String.t()
}
```

Handle returned while a UDF package propagates through the cluster.

Use `status/1` for one poll or `wait/2` to block until every active node
reports the package. `wait/2` accepts `:poll_interval` and `:timeout` in
milliseconds.

# `wait_opt`

```elixir
@type wait_opt() ::
  {:poll_interval, non_neg_integer()} | {:timeout, non_neg_integer()}
```

Option accepted by `wait/2`.

# `wait_opts`

```elixir
@type wait_opts() :: [wait_opt()]
```

Keyword options accepted by `wait/2`.

# `status`

```elixir
@spec status(t()) :: {:ok, :complete | :in_progress} | {:error, Aerospike.Error.t()}
```

Returns whether the UDF package is visible on every active cluster node.

# `wait`

```elixir
@spec wait(struct(), keyword()) :: :ok | {:error, Aerospike.Error.t()}
@spec wait(t(), wait_opts()) :: :ok | {:error, Aerospike.Error.t()}
```

Blocks until the UDF package is visible on every active node.

Supported options:

  * `:poll_interval` — milliseconds to sleep between status checks.
    Defaults to `1_000`.
  * `:timeout` — maximum milliseconds to wait. When omitted, polling
    continues until registration completes or returns an error.

---

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