Search code examples
orbeon

Orbeon processors, processing in parallel or sequential


I am trying to find out if Orbeon processes in parallel or in sequence.

We have a pipeline that fetches from 2 data sources and amalgamates in a single response. Does the processing below happen in parallel and combine when both sources have retrieved or is it sequential? If sequential, can it be made to be parallel?

<!-- processor that gets the xml data from ML db -->
<p:processor name="oxf:url-generator">
                <p:input name="config" href="#conditions" transform="oxf:xslt" >
                                <config xsl:version="2.0">
                                                <url>
                                                                <xsl:text>$MLDOMAIN/queries/legislation.xq</xsl:text>
                                                                <xsl:text>?type=</xsl:text>
                                                                <xsl:value-of select="encode-for-uri(/conditions/parameters/type)" />
                                                                <xsl:text>&amp;year=</xsl:text>
                                                                <xsl:value-of select="encode-for-uri(/conditions/parameters/year)" />
                                                                <xsl:text>&amp;number=</xsl:text>
                                                                <xsl:value-of select="encode-for-uri(/conditions/parameters/number)" />
                                                                <xsl:text>&amp;section=</xsl:text>
                                                                <xsl:value-of select="encode-for-uri(/conditions/parameters/section)" />
                                                </url>
                                                <cache-control>
                                                                <use-local-cache>false</use-local-cache>
                                                </cache-control>
                                </config>
                </p:input>
                <p:output name="data" id="xmlData"/>
</p:processor>
<!-- processor calls a pipeline to return the GraphDB data -->
<p:processor name="oxf:pipeline">
                <p:input name="config" href="task-xml.xpl"/>
                <p:input name="legislation" href="#legislation"/>
                <p:input name="section" href="#section"/>
                <p:input name="requestsections" href="#requestsections"/>
                <p:input name="minorType" href="#xmlData#xpointer(/l:Fragment/u:Metadata//u:DocumentMinorType)"/>
                <p:input name="instance" href="#instance"/>
                <p:input name="amendments" href="#instance#xpointer(/parameters/amendments)"/>
                <p:input name="date" href="#date"/>
                <p:input name="basedate" href="#basedate"/>
                <p:input name="conditions" href="#conditions"/>
                <p:output name="data" id="taskXml"/>
</p:processor>
<!-- processor that combines the two sources into a single xml output -->
<p:processor name="oxf:xslt">
                <p:input name="config" href="../../xsl/common/edit-xml-xmetal5.xsl"/>
                <p:input name="data" href="#xmlData"/>
                <p:input name="tasks" href="#taskXml"/>
                <p:output name="data" ref="data"/>
</p:processor>

Solution

  • A pipeline won't run "in parallel", as in "using multiple threads", but it uses streaming.

    In your case the URL Generator makes a request running the legislation.xq XQuery in MarkLogic, and while it reads the data it passes it "down" to the rest of the pipeline, which transforms this data (assuming that your task-xml.xpl and edit-xml-xmetal5.xsl do something of that sort), and this is happening as the data is being received by the URL Generator from MarkLogic.