mixin

Funcs

Funcs : Funcs

meta mixin slots task

Lookup a task by id which is any value supported by toRecId()

tasks

List the current tasks as a grid

taskIsRunning

Is the current context running asynchrounsly inside a task

taskCur

Return current task if running within the context of an asynchronous task

taskRun

Run the given expression asynchronously in an ephemeral task

taskRestart

Restart a task

taskCancel

Set cancel flag for the given task

taskProgress

Update the current running task's progress data with given dict

taskSend

Asynchronously send a message to the given task for processing

taskSendLater

Schedule a message for delivery after the specified period of duration has elapsed

taskSendWhenComplete

Schedule a message for delivery after the given future has completed

taskLocalGet

Get a task local variable by name or def if not defined

taskLocalSet

Set a task local variable

taskLocalRemove

Remove a task local variable by name

futureGet

Block current thread until a future's result is ready

futureCancel

Cancel a future

futureState

Return current state of a future as one of the following strings

futureIsComplete

Return if a future has completed or is still pending a result

futureWaitFor

Block until a future transitions to a completed state (ok, err, or canceled)

futureWaitForAll

Block on a list of futures until they all transition to a completed state

taskSleep

Sleep for the given duration

taskRefreshUser

Refresh the user account used for tasks

task (id: Obj?, checked: Bool) => Dict? <admin>

Lookup a task by id which is any value supported by toRecId().

tasks (opts: Dict?) => Grid <admin>

List the current tasks as a grid. The format of this grid is subject to change.

taskIsRunning () => Bool <admin>

Is the current context running asynchrounsly inside a task

taskCur (checked: Bool) => Dict? <admin>

Return current task if running within the context of an asynchronous task. If context is not within a task, then return null or raise an exception based on checked flag.

taskRun (expr: Obj?, msg: Dict?) => Future <admin>

Run the given expression asynchronously in an ephemeral task. Return a future to track the asynchronous result. Note the expr passed cannot use any variables from the current scope. See hx.task.

taskRestart (task: Obj) => Dict <admin>

Restart a task. This kills the tasks and discards any pending messages in its queue. See hx.task.

taskCancel (task: Obj) => Obj? <admin>

Set cancel flag for the given task. Cancelling a task sets an internal flag which is checked by the context's heartbeat on every Axon call. On the next Axon call the current message context will raise a CancelledErr which will be raised by the respective future. Cancelling a task does not interrupt any current operations, so any blocking future or I/O calls should always use a timeout.

taskProgress (progress: Obj?) => Obj? <admin>

Update the current running task's progress data with given dict. This is a silent no-op if the current context is not running in a task.

Example:

 // report progress percentage processing a list of records
 recs.each((rec, index)=>do
   taskProgress({percent: round(100%*index/recs.size), cur:rec.dis})
   processRec(rec)
 end)
 taskProgress({percent:100%})

taskSend (task: Obj, msg: Obj?) => Future <admin>

Asynchronously send a message to the given task for processing. Return a future to track the asynchronous result. See hx.task.

taskSendLater (task: Obj, dur: Number, msg: Obj?) => Future <admin>

Schedule a message for delivery after the specified period of duration has elapsed. Once the period has elapsed the message is appended to the end of the task's queue. Return a future to track the asynchronous result. See hx.task.

taskSendWhenComplete (task: Obj, future: Future, msg: Obj?) => Future <admin>

Schedule a message for delivery after the given future has completed. Completion may be due to the future returning a result, throwing an exception, or cancellation. Return a future to track the asynchronous result. See hx.task.

taskLocalGet (name: Str, def: Obj?) => Obj? <admin>

Get a task local variable by name or def if not defined. Must be running in a task context. See hx.task.

taskLocalSet (name: Str, val: Obj?) => Obj? <admin>

Set a task local variable. The name must be a valid tag name. Must be running in a task context. See hx.task.

taskLocalRemove (name: Str) => Obj? <admin>

Remove a task local variable by name. Must be running in a task context. See hx.task.

futureGet (future: Future, timeout: Number?) => Obj? <admin>

Block current thread until a future's result is ready. A null timeout will block forever. If an exception was raised by the asynchronous computation, then it is raised to the caller. See hx.task.

futureCancel (future: Future) => Obj? <admin>

Cancel a future. If the message is still queued then its removed from the actor's queue and will not be processed. No guarantee is made that the message will not be processed. See hx.task.

futureState (future: Future) => Str <admin>

Return current state of a future as one of the following strings:

  • pending: still queued or being processed
  • ok: completed with result value
  • err: completed with an exception
  • cancelled: future was cancelled before processing See hx.task.

futureIsComplete (future: Future) => Bool <admin>

Return if a future has completed or is still pending a result. A future is completed by any of the following conditions:

  • the task processes the message and returns a result
  • the task processes the message and raises an exception
  • the future is cancelled See hx.task.

futureWaitFor (future: Future, timeout: Number?) => Future <admin>

Block until a future transitions to a completed state (ok, err, or canceled). If timeout is null then block forever, otherwise raise a TimeoutErr if timeout elapses. Return future. See hx.task.

futureWaitForAll (futures: List, timeout: Number?) => List <admin>

Block on a list of futures until they all transition to a completed state. If timeout is null block forever, otherwise raise TimeoutErr if any one of the futures does not complete before the timeout elapses. See hx.task.

taskSleep (dur: Number) => Obj? <admin>

Sleep for the given duration. If not currently running in a task this is a no-op. This will block the current task's thread and prevent other tasks from using it until the sleep completes. So this function should be used sparingly and with care.

taskRefreshUser () => Obj? <admin>

Refresh the user account used for tasks

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST