Aerospike.ExecuteTask (Aerospike Driver v0.3.1)

Copy Markdown View Source

Tracks background query execution progress.

Summary

Types

Background query task kind used when polling server job state.

t()

Handle returned by background query execution helpers.

Option accepted by wait/2.

Keyword options accepted by wait/2.

Functions

Parses a raw background query status response from the Aerospike info protocol.

Returns the current background query status across the target nodes.

Blocks until the background query completes or the timeout is exceeded.

Types

kind()

@type kind() :: :query_execute | :query_udf

Background query task kind used when polling server job state.

t()

@type t() :: %Aerospike.ExecuteTask{
  conn: GenServer.server(),
  kind: kind(),
  namespace: String.t(),
  node_name: String.t() | nil,
  set: String.t(),
  task_id: non_neg_integer()
}

Handle returned by background query execution helpers.

node_name is set when the background job was started on one node. When it is nil, status/1 and wait/2 poll every active node in the cluster.

wait_opt()

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

Option accepted by wait/2.

wait_opts()

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

Keyword options accepted by wait/2.

Functions

parse_status_response(response)

@spec parse_status_response(String.t()) ::
  :complete | :in_progress | :not_found | {:error, Aerospike.Error.t()}

Parses a raw background query status response from the Aerospike info protocol.

Empty replies and server ERROR:2 replies are treated as :not_found because a background task can briefly be invisible before every target node has observed it.

status(task)

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

Returns the current background query status across the target nodes.

wait(task, opts \\ [])

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

Blocks until the background query completes or the timeout is exceeded.

Supported options:

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