class PlaceOS::Driver::Task
- PlaceOS::Driver::Task
- Reference
- Object
Defined in:
placeos-driver/task.crConstant Summary
-
DEFAULT_BACKTR =
[] of String
-
DEFAULT_RESULT =
"null"
Constructors
Instance Method Summary
-
#abort(reason = nil, code : Int32 | Nil = 500)
call when the task has failed and we don't want to retry
- #apparent_priority : Int32
- #apparent_priority=(apparent_priority : Int32)
- #backtrace : Array(String)
- #clear_queue : Bool
- #clear_queue=(clear_queue : Bool)
-
#code : Int32 | Nil
the response code that the browser will receive when executing via HTTP
-
#code=(code : Int32 | Nil)
the response code that the browser will receive when executing via HTTP
- #delay : Time::Span?
- #error_class : String?
- #last_executed : Int64
- #name : String?
- #payload : String
- #priority : Int32
- #priority=(priority : Int32)
- #processing : Slice(UInt8), PlaceOS::Driver::Task -> Nil?
- #processing=(processing : Nil | Slice(UInt8), PlaceOS::Driver::Task -> _)
-
#reset_timers
a partial response was received and we don't want the timeout to trigger a retry
- #retries : Int32
- #retries=(retries : Int32)
-
#retry(reason = nil)
call when possible temporary failure or device busy
- #state : State
-
#success(result = nil, code : Int32 | Nil = 200)
call when result is a success.
- #wait : Bool
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)
#
Instance Method Detail
call when the task has failed and we don't want to retry
def code=(code : Int32 | Nil)
#
the response code that the browser will receive when executing via HTTP
call when result is a success.
The result should support conversion to JSON otherwise the remote will only receive nil