Module: Roby::TaskStructure::ExecutionAgentStart Private

Defined in:
lib/roby/task_structure/executed_by.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

This module is hooked in Roby::TaskEventGenerator to check that a task which is being started has a suitable execution agent, and to start it if it’s not the case

Defined Under Namespace

Modules: Installer

Instance Method Summary collapse

Instance Method Details

#calling(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/roby/task_structure/executed_by.rb', line 240

def calling(context)
    super

    agent = task.execution_agent
    return if agent&.ready?

    if agent
        raise ExecutionAgentNotReady.new(task),
              "cannot start #{task}, its agent is not ready"
    elsif task.model.execution_agent
        raise MissingRequiredExecutionAgent.new(task),
              "the model of #{task} requires an execution agent, "\
              "but the task has none"
    end
end