class Mosquito::Task
- Mosquito::Task
- Reference
- Object
Overview
A Task is a unit of work which will be performed by a Job. Tasks know how to:
- store and retrieve their data to and from the datastore
- figure out what Job class they match to
- build an instance of that Job class and pass off the config data
- Ask the job to run
Task data is called #config
and is persisted in the backend under the key
mosquito:task:task_id
.
Defined in:
mosquito/task.crConstant Summary
-
CONFIG_KEY_PREFIX =
"task"
Constructors
Class Method Summary
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #build_job
- #config : Hash(String, String)
- #config=(config : Hash(String, String))
- #config_key
- #delete(in ttl = 0)
- #enqueue_time : Time
- #executed?(*args, **options)
- #executed?(*args, **options, &)
- #fail
- #failed(*args, **options)
- #failed(*args, **options, &)
- #failed?(*args, **options)
- #failed?(*args, **options, &)
- #id : String
- #job : Mosquito::Job
- #reschedule_interval
- #rescheduleable?
- #rescheduled(*args, **options)
- #rescheduled(*args, **options, &)
- #retry_count : Int32
- #run
- #store
- #succeeded?(*args, **options)
- #succeeded?(*args, **options, &)
-
#to_s(io : IO)
Appends a short String representation of this object which includes its class name and its object address.
- #type : String
Constructor Detail
def self.new(type : String, enqueue_time : Time = Time.utc, id : String | Nil = nil, retry_count : Int32 = 0)
#
Class Method Detail
Instance Method Detail
def ==(other : self)
#
Description copied from class Reference
Returns true
if this reference is the same as other. Invokes same?
.
def to_s(io : IO)
#
Description copied from class Reference
Appends a short String representation of this object which includes its class name and its object address.
class Person
def initialize(@name : String, @age : Int32)
end
end
Person.new("John", 32).to_s # => #<Person:0x10a199f20>