This site is work in progress and does not yet describe all available steps.

 p:sleep (3.1) 

Delays the execution of the pipeline.

Summary

<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

input

source

true

any

true

The source document(s)

output

result

true

any

true

The resulting document(s). These will be exactly the same as what appeared on the source port.

Options:

Name

Type

Req?

Description

duration

xs:nonNegativeInteger

true

The duration of the delay, expressed in milliseconds.

Description

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.

Additional details

  • 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.

Reference information

This description of the p:sleep step is for XProc version: 3.1. This is a required step (an XProc 3.1 processor must support this).

The formal specification for the p:sleep step can be found here.

The p:sleep step is part of categories: