Code Examples
A repository of 155 code examples for BeepBeep
basic.PullWithoutSource Class Reference

What happens when trying to pull events on a processor connected to no input. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

What happens when trying to pull events on a processor connected to no input.

The chain of processors in this example is very simple, it is composed of a single Passthrough processor:

Processor chain

When attempting to pull an event into the input of this processor, the passthrough will attempt to pull it, in turn, from its input. The problem lies in the fact that nothing is connect to the input. In BeepBeep, every input stream of every processor must be connected to something. The only way to close a chain is by using a Source (a processor with zero input stream). Thus, the expected output of this program is this:

Exception in thread "main" ca.uqac.lif.cep.Pullable$PullableException:
Input 0 of this processor is connected to nothing
 at ca.uqac.lif.cep.UniformProcessor$OutputPullable.hasNext(UniformProcessor.java:303)
 at ca.uqac.lif.cep.UniformProcessor$OutputPullable.pull(UniformProcessor.java:263)
 at basic.PullWithoutSource.main(PullWithoutSource.java:62)

The opposite also happens when trying to pull events from a processor connected to no input. See PushWithoutSink.

Author
Sylvain Hallé Easy

Definition at line 53 of file PullWithoutSource.java.

Member Function Documentation

◆ main()

static void basic.PullWithoutSource.main ( String []  args)
static

Create a Passthrough processor

Definition at line 55 of file PullWithoutSource.java.

56  {
57  /// Create a Passthrough processor
58  Passthrough passthrough = new Passthrough();
59  /* Get a reference to the Pullable for its input stream */
60  Pullable p = passthrough.getPullableOutput();
61  /* Try to pull an event. This will throw an exception and stop
62  * the program. */
63  p.pull();
64  ///
65  }

The documentation for this class was generated from the following file: