Skip to content

Instantly share code, notes, and snippets.

@bluestreak01
Created July 8, 2016 20:05
Show Gist options
  • Save bluestreak01/3b421e3a4e7ecc3572650933479898a8 to your computer and use it in GitHub Desktop.
Save bluestreak01/3b421e3a4e7ecc3572650933479898a8 to your computer and use it in GitHub Desktop.
*
* +-----+
* +----->| C1 |
* | +-----+
* |
* +----+ +-----+
* | P1 |--->| C2 |
* +----+ +-----+
* |
* | +-----+
* +----->| C3 |
* +-----+
SPSequence pubSeq = new SPSequence(cycle);
Sequence sub1 = new SCSequence();
Sequence sub2 = new SCSequence();
Sequence sub3 = new SCSequence();
FanOut fanOut;
pubSeq.followedBy(fanOut = new FanOut(sub1, sub2, sub3));
sub1.followedBy(pubSeq);
sub2.followedBy(pubSeq);
sub3.followedBy(pubSeq);
* +--------+
* +--->| worker |
* +-----+ | +--------+
* | pub |-->|
* +-----+ | +--------+
* +--->| worker |
* +--------+
SPSequence pubSeq = new SPSequence(cycle);
MCSequence subSeq = new MCSequence(cycle, null);
pubSeq.followedBy(subSeq);
subSeq.followedBy(pubSeq);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment