class Mosquito::PeriodicJobRun
- Mosquito::PeriodicJobRun
- Reference
- Object
Defined in:
mosquito/periodic_job_run.crConstructors
Instance Method Summary
-
#class : Mosquito::PeriodicJob.class
Returns the runtime
Class
of an object. - #class=(class __arg0 : Mosquito::PeriodicJob.class)
-
#execute
Enqueues the job for execution
- #interval : Time::Span | Time::MonthSpan
- #interval=(interval : Time::Span | Time::MonthSpan)
-
#last_executed_at
The last executed timestamp, or "never" if it doesn't exist.
-
#last_executed_at=(time : Time)
Updates the last executed timestamp in the backend, and schedules the metadata for deletion after 3*interval seconds.
-
#last_executed_at?
The last executed timestamp for this periodicjob tracked by the backend.
- #metadata : Metadata
-
#try_to_execute : Bool
Check the last executed timestamp against the current time, and enqueue the job if it's time to execute.
Constructor Detail
Instance Method Detail
Returns the runtime Class
of an object.
1.class # => Int32
"hello".class # => String
Compare it with typeof
, which returns the compile-time type of an object:
random_value = rand # => 0.627423
value = random_value < 0.5 ? 1 : "hello"
value # => "hello"
value.class # => String
typeof(value) # => Int32 | String
Updates the last executed timestamp in the backend, and schedules the metadata for deletion after 3*interval seconds.
For Time::Span intervals, the TTL is set to 3 * interval. For Time::MonthSpan intervals, the TTL is set to approximately 3 * interval.
A month is approximated to 2635200 seconds, or 30.5 days.
Check the last executed timestamp against the current time, and enqueue the job if it's time to execute.