class PlaceOS::Driver::Task

Defined in:

placeos-driver/task.cr

Constant Summary

DEFAULT_BACKTR = [] of String
DEFAULT_RESULT = "null"

Constructors

Instance Method Summary

Constructor Detail

def self.new(queue : PlaceOS::Driver::Queue, callback : Proc(Task, Nil), priority : Int32, timeout : Time::Span, retries : Int32, wait : Bool, name : String | Nil, delay : Time::Span | Nil, clear_queue : Bool = false) #

[View source]

Instance Method Detail

def abort(reason = nil, code : Int32 | Nil = 500) #

call when the task has failed and we don't want to retry


[View source]
def apparent_priority : Int32 #

[View source]
def apparent_priority=(apparent_priority : Int32) #

[View source]
def backtrace : Array(String) #

[View source]
def clear_queue : Bool #

[View source]
def clear_queue=(clear_queue : Bool) #

[View source]
def code : Int32 | Nil #

the response code that the browser will receive when executing via HTTP


[View source]
def code=(code : Int32 | Nil) #

the response code that the browser will receive when executing via HTTP


[View source]
def delay : Time::Span? #

[View source]
def error_class : String? #

[View source]
def last_executed : Int64 #

[View source]
def name : String? #

[View source]
def payload : String #

[View source]
def priority : Int32 #

[View source]
def priority=(priority : Int32) #

[View source]
def processing : Slice(UInt8), PlaceOS::Driver::Task -> Nil? #

[View source]
def processing=(processing : Nil | Slice(UInt8), PlaceOS::Driver::Task -> _) #

[View source]
def reset_timers #

a partial response was received and we don't want the timeout to trigger a retry


[View source]
def retries : Int32 #

[View source]
def retries=(retries : Int32) #

[View source]
def retry(reason = nil) #

call when possible temporary failure or device busy


[View source]
def state : State #

[View source]
def success(result = nil, code : Int32 | Nil = 200) #

call when result is a success.

The result should support conversion to JSON otherwise the remote will only receive nil


[View source]
def wait : Bool #

[View source]