Delays the execution of the pipeline.
<p:declare-step type="p:sleep"> <input port="source" primary="true" content-types="any" sequence="true"/> <output port="result" primary="true" content-types="any" sequence="true"/> <option name="duration" as="xs:nonNegativeInteger" required="true"/> </p:declare-step>
The p:sleep
step delays the execution of the pipeline for a specified number of milliseconds. Source documents are passed unchanged (like in
a p:identity
step).
Ports:
Type | Port | Primary? | Content types | Seq? | Description |
---|---|---|---|---|---|
|
|
|
|
| The source document(s) |
|
|
|
|
| The resulting document(s). These will be exactly the same as what appeared on the |
Options:
Sometimes it is useful to stop executing a pipeline for a little while, for instance when interacting with remote web servers. The p:sleep
step does exactly this: it just stops executing the pipeline for the number of milliseconds specified in the duration
option.
Some XProc processors will execute steps in parallel when the flow of documents in the pipeline makes this possible (multi-threaded
implementations). The p:sleep
step is guaranteed to delay the execution of the steps that depend on its output only. Whatever happens to other
steps (steps that run in parallel and do not depend on the output of the p:sleep
invocation) is implementation-defined and therefore depends on
the XProc processor used.
p:sleep
preserves all document-properties of the document(s) appearing on its source
port.