class Flor::Pro::Schedule

Public Instance Methods

pre_execute() click to toggle source
# File lib/flor/punit/schedule.rb, line 48
def pre_execute

  @node['atts'] = []
end
receive() click to toggle source
Calls superclass method Flor::Procedure#receive
# File lib/flor/punit/schedule.rb, line 77
def receive

  return [] if @node['scheduled']
  super
end
receive_last() click to toggle source
# File lib/flor/punit/schedule.rb, line 53
def receive_last

  fun = @fcid > 0 ? payload['ret'] : nil

  fail Flor::FlorError.new(
    "missing a function to call when the scheduler triggers", self
  ) unless fun

  m = apply(fun, [], tree[2], anid: false).first

  t, s =
    @node['atts'].find { |k, v| %w[ cron at in every ].include?(k) } ||
    @node['atts'].find { |k, v| k == nil }

  fail Flor::FlorError.new(
    "missing a schedule", self
  ) unless s

  @node['scheduled'] = true

  wrap_schedule('type' => t, 'string' => s, 'message' => m) +
  flank
end
wrap_cancel_children(h={}) click to toggle source

“schedule” keeps track of its children, but does not cascade ‘cancel’ to them, unless the cancel flavour is ‘kill’.

Calls superclass method Flor::Procedure#wrap_cancel_children
# File lib/flor/punit/schedule.rb, line 86
def wrap_cancel_children(h={})

  h['flavour'] == 'kill' ? super : []
end