3.1. Parallel Combinator

F | G

Execution of expression F | G occurs by executing F and G concurrently. Whenever F or G communicates with a service or publishes a value, F | G does so as well. Therefore, F | G interleaves the publications of F and G arbitrarily.

3.1.1. Syntax

[11]Parallel::= Expression | Expression  

Combinator Precedence Level: sequential > parallel > pruning > otherwise [Full Table]

3.1.2. Notable Identities

F | G | H = (F | G) | H (Left Associative)
F | G | H = F | (G | H) (Right Associative)
F | G = G | F (Commutative)

3.1.3. Type

The type of F | G is the join of the types of F and G.

3.1.4. Examples

Parallel Publication
{- Publish 1 and 2 in parallel -}

1 | 1+1

{-
OUTPUT:PERMUTABLE
1
2
-}
Parallel Site Calls
include "search.inc"

{- Access two search sites, Google and Yahoo, in parallel.
   
   Publish any results they return.
   
   Since each call may publish a value, the expression
   may publish up to two values.
-}  

Google("cupcake") | Yahoo("cupcake")

3.1.5. Related Links

Related Reference Topics

Related Tutorial Sections