Closed ndw closed 4 months ago
Alternatively, add a wait
attribute to p:identity
and possibly to all steps? The semantic is that it waits the given amount of milliseconds (?) before executing the step.
Perhaps. I did consider suggesting it as an attribute on p:identity
, but I think there's a risk if we go down that road that we'll find all sorts of one-off attributes to add and that's not going to be very discoverable for users.
Adding it to all the steps seems like overkill to me.
Having now implemented it and written a test, I think I'd prefer to say that the duration
is a string that must be a valid xs:duration
. It would be a lot nicer to write
<p:sleep duration="PT3S"/>
than it is to write
<p:sleep duration="{xs:dayTimeDuration('PT3S')}"/>
Make the sleep time a non-negative number of milliseconds.
When interacting with external services, it's sometimes necessary to pause so the service has time to process your request.
This came up most recently in the test suite. We're using Sendria to test the
p:send-mail
step. The way it works is that Sendria provides an SMTP server and a web server. You send email to its SMTP port and it reports the results on its web server. Unfortunately, if you just make the calls in succession:it's fairly common for the summary to be in correct because Sendria is still ingesting the message.
I propose a
p:sleep
step:The step is semantically the same as
p:identity
except that it will pause for a period not less than the specified duration before sending the document(s).(We've sometimes argued that proposals for new steps belong in the V.next repository, but the absence of this step seems actively harmful and I propose we add it as an "erratum".)