waitPeers

Note

This feature is available only in Tonomi Platform version 37 and above, and only in component-based manifests.

Waits until required number of peers on specified interfaces will be available, or fails after timeout. It doesn’t guarantee that these components will stay up, but it is reasonable to assume that the system has seen all the peers up before it unblocked the execution flow.

After step finish, peers will become available for use in steps getSignals, commandCall, execrun and chefrun. These steps will invoke commands on the updated peer set, regardless of their status at the time of execution.

If some peers should not be called by these steps, either because they have been destroyed, or bindings removed, or they have moved to non-running status, waitPeers step should be called again to refresh peer set known by workflow.

Parameters

Name Type Constraints Default Definition
interfaces map     Keys correspond to interface names, and values represent minimal required peers count.
timeout int or string     Deadline for waiting with optional time unit suffix. Supported time units are hour, minute and second (both singular and plural forms). If no time unit specified, seconds will be used.

Example Usage

interfaces:
  compute:
    exec:       send-command(string command, int timeout => string stdOut, string stdErr => string stdOut, string stdErr, int exitCode)
configuration:
  configuration.workflows:
    launch:
      steps:
        - waitPeers:
            action: waitPeers
            parameters:
              interfaces:
                compute: 3
              timeout:
                10 minute