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

What happens when trying to push events on a processor connected to no output. More...

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

What happens when trying to push events on a processor connected to no output.

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

Processor chain

When attempting to push an event into the input of this processor, the passthrough will attempt to push it, in turn, through its output. The problem lies in the fact that nothing is connect to the output. In BeepBeep, pushed events cannot just disappear into thin air: they must be collected by some Sink (a processor with zero output streams). Thus, the expected output of this program is this:

Exception in thread "main" ca.uqac.lif.cep.Pushable$PushableException:
Output 0 of this processor is connected to nothing
 at ca.uqac.lif.cep.UniformProcessor$InputPushable.push(UniformProcessor.java:178)
 at basic.PushWithoutSink.main(PushWithoutSink.java:35)

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

Author
Sytlvain Hallé Easy

Definition at line 51 of file PushWithoutSink.java.

Member Function Documentation

◆ main()

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

Create a Passthrough processor

Definition at line 53 of file PushWithoutSink.java.

54  {
55  /// Create a Passthrough processor
56  Passthrough passthrough = new Passthrough();
57  /* Get a reference to the Pushable for its input stream */
58  Pushable p = passthrough.getPushableInput();
59  /* Try to push an event. This will throw an exception and stop
60  * the program. */
61  p.push("foo");
62  ///
63  }

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