Issue Type: New Feature New Feature
Assignee: Jesse Glick
Components: workflow-plugin
Created: 12/Nov/14 2:52 PM
Description:

WatchYourStep (in test sources) is actually similar to something that has been requested: a way to wait until a named file appears in the workspace, or until the content of a file has changed, etc. All these things could be handled by a step like this:

waitForCond {
    readFile 'flag'
}

or


waitForCond {
    readFile('flag') == 'ready'
}

Roughly similar to retry, it would run its block, and if the block either throws an exception or returns false, it would run it again. Or it might be more intuitive to expect only a boolean return value and force the first example to be written as

waitForCond {
    try {
        readFile 'flag'
        return true
    } catch (FileNotFoundException _) {
        return false
    }
}

(Even if an exception is permitted as a synonym for false, InterruptedException should be thrown up.)

Unlike retry there would not need to be any limit to the number of retries, and there would be an exponentially increasing delay between successive retries: run the first time immediately, then retry after 100ms, then continue to multiply the delay by a factor of 1.3 or something like that (perhaps up to some maximum delay like DurableTaskStep has).

Project: Jenkins
Priority: Minor Minor
Reporter: Jesse Glick
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to