class Mosquito::Task

Overview

A Task is a unit of work which will be performed by a Job. Tasks know how to:

Task data is called #config and is persisted as a Hash in Redis under the key mosquito:task:task_id.

Defined in:

mosquito/task.cr

Constant Summary

ID_PREFIX = {"mosquito", "task"}

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(type : String) #

[View source]

Class Method Detail

def self.redis_key(*parts) #

[View source]
def self.retrieve(id : String) #

[View source]

Instance Method Detail

def build_job #

[View source]
def config : Hash(String, String) #

[View source]
def config=(config : Hash(String, String)) #

[View source]
def delete #

[View source]
def enqueue_time : Time | Nil #

[View source]
def executed?(*args, **options) #

[View source]
def executed?(*args, **options, &) #

[View source]
def fail #

[View source]
def failed(*args, **options) #

[View source]
def failed(*args, **options, &) #

[View source]
def failed?(*args, **options) #

[View source]
def failed?(*args, **options, &) #

[View source]
def id : String | Nil #

[View source]
def job : Mosquito::Job #

[View source]
def redis_key #

[View source]
def reschedule_interval #

[View source]
def rescheduleable? #

[View source]
def rescheduled(*args, **options) #

[View source]
def rescheduled(*args, **options, &) #

[View source]
def retry_count : Int32 #

[View source]
def run #

[View source]
def store #

[View source]
def succeeded?(*args, **options) #

[View source]
def succeeded?(*args, **options, &) #

[View source]
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>

[View source]
def type : String #

[View source]