Skip to content

Commit

Permalink
Merge pull request #577 from ndw/iss-574
Browse files Browse the repository at this point in the history
Add p:sleep step
  • Loading branch information
ndw authored Jun 7, 2024
2 parents 9805230 + 25849e1 commit 5d88925
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions steps/src/main/xml/specification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ PSVI annotations.</para>
<xi:include href="steps/set-attributes.xml"/>
<xi:include href="steps/set-properties.xml"/>
<xi:include href="steps/sink.xml"/>
<xi:include href="steps/sleep.xml"/>
<xi:include href="steps/split-sequence.xml"/>
<xi:include href="steps/store.xml"/>
<xi:include href="steps/string-replace.xml"/>
Expand Down
30 changes: 30 additions & 0 deletions steps/src/main/xml/steps/sleep.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:p="http://www.w3.org/ns/xproc"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="c.sleep">
<title>p:sleep</title>

<para>The <tag>p:sleep</tag> step introduces a delay.</para>

<p:declare-step type="p:sleep">
<p:input port="source" sequence="true" content-types="any"/>
<p:output port="result" sequence="true" content-types="any"/>
<p:option name="duration" as="xs:nonNegativeInteger" required="true"/>
</p:declare-step>

<para>The <tag>p:sleep</tag> step copies each of the documents on the
<port>source</port> port to the <port>result</port> port without changing them.
Before copying the documents, it pauses for a period of time not less
than <code>duration</code> milliseconds.</para>

<note>
<para>In multi-threaded implementations, there is no guarantee that this
will pause the execution of more than one thread. However, any steps that
depend on the output of this step will wait for this step to complete.</para>
</note>

<simplesect>
<title>Document properties</title>
<para feature="identity-preserves-all">All document properties are preserved.</para>
</simplesect>
</section>

0 comments on commit 5d88925

Please sign in to comment.