class Tasker::Future(R)

Defined in:

tasker/future.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(block : -> R) #

[View source]

Instance Method Detail

def cancel(msg) #

We'll force the state into canceled as we use this to prevent rescheduling


[View source]
def complete #

Records the terminal state once the callback has finished. The task invokes this under its own lock — the same lock #cancel holds — so completion and cancellation are serialised without this class needing a mutex of its own. Completion never overwrites a cancel, so state == Canceled reliably means "the user cancelled; do not reschedule".


[View source]
def state #

The future is holding the state for our scheduled task


[View source]
def trigger #

As we are controlling the delay we need direct access to run_compute


[View source]
def wait_complete #

We also want direct access to wait without grabbing the computed response


[View source]