lib/demiurge/agent.rb
# Queue an action to be run after previous actions are complete,
# and when the agent is no longer busy from taking them. The
# action queue entry is assigned a unique-per-agent queue number,
# which is returned from this action.
#
# @param action_name [String] The name of the action to take when possible
# @param args [Array] Additional arguments to pass to the action's code block
# @return [Integer] Returns the queue number for this action - note that queue numbers are only unique per-agent
# @since 0.0.1
Queue an action to be run after previous actions are complete,
and when the agent is no longer busy from taking them. The
action queue entry is assigned a unique-per-agent queue number,
which is returned from this action.
Queue an action to be run after previous actions are complete and when the agent is no longer busy from taking them . The action queue entry is assigned a unique - per - agent queue number which is returned from this action .
def queue_action(action_name, *args)
      raise ::Demiurge::Errors::NoSuchActionError.new("Not an action: #{action_name.inspect}!", { "action_name" => action_name },
                                                      execution_context: @engine.execution_context) unless get_action(action_name)
      state["queue_number"] += 1
      state["queued_actions"].push([action_name, args, state["queue_number"]])
      state["queue_number"]
    end
def queue_action ( action_name , * args ) raise :: Demiurge :: Errors :: NoSuchActionError . new ( "Not an action: #{action_name.inspect}!" , { "action_name" => action_name } , execution_context : @engine . execution_context ) unless get_action ( action_name ) state [ "queue_number" ] += 1 state [ "queued_actions" ] . push ( [ action_name , args , state [ "queue_number" ] ] ) state [ "queue_number" ] end
Queue an action to be run after previous actions are complete,
and when the agent is no longer busy from taking them.
Queue an action to be run after previous actions are complete and when the agent is no longer busy from taking them .
Returns the queue number for this action - note that queue numbers are only unique per-agent
Returns the queue number for this action - note that queue numbers are only unique per - agent
Integer
action_name
The name of the action to take when possible
The name of the action to take when possible
args
Additional arguments to pass to the action's code block
Additional arguments to pass to the action ' s code block
since
None