Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add p:sleep step #577

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>