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 as a Hash in Redis under the key
mosquito:task:task_id.
Defined in:
mosquito/task.crConstant Summary
- 
        ID_PREFIX = {"mosquito", "task"}
Constructors
Class Method Summary
Instance Method Summary
- #build_job
- #config : Hash(String, String)
- #config=(config : Hash(String, String))
- #delete(in ttl = 0)
- #enqueue_time : Time | Nil
- #executed?(*args, **options)
- #executed?(*args, **options, &)
- #fail
- #failed(*args, **options)
- #failed(*args, **options, &)
- #failed?(*args, **options)
- #failed?(*args, **options, &)
- #id : String | Nil
- #job : Mosquito::Job
- #redis_key
- #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
Class Method Detail
Instance Method Detail
        
        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>