Method: Chore.start
- Defined in:
- lib/chore.rb
.start(task, opts = {}) ⇒ Object
Let the server know that you’ve started a task. Options you can include are:
- :do_every
-
Indicate that the task should run every X seconds. If this does not happen, show task status in RED.
- :grace_period
-
Allow a grace period for the above option. If we are late but withing the grace period, show task status in YELLOW.
- :finish_in
-
Indicate that the task should finish in X seconds. If we haven’t received a finish message by then, show the task in RED.
- :expire_in
-
Remove the task after X seconds. This may be useful to keep the task list clean.
36 37 38 39 |
# File 'lib/chore.rb', line 36 def self.start task, opts={} opts[:start_time] ||= Time.now().to_i send( [:start, task, opts] ) end |