Defining streams
You can use a stream variable to reference a stream. A stream variable declaration has the following form:
stream<type> name
Replace type with the type of the items in the stream. This can be any Apama data type.
Replace name with an identifier for the stream. For example:
stream<Tick> ticks;
A stream variable can be a field in an event. However, you cannot route, enqueue, or emit an event that contains a stream variable field.
There are two ways to create a stream:
To obtain a reference to an existing stream, you must assign from or clone another stream value.
An inert stream never generates any output. There are a number of ways to create an inert stream including, but not limited to, the following:
Calling
new on a
stream type or a type that contains a stream
Declaring a global variable of
stream type, or a type that contains a stream
Spawning a monitor instance that contains a stream value
Note: It is permissible to define a stream variable that references a stream of stream type items. In such a definition, be sure to insert a space between the consecutive right-angle brackets. For example: stream<stream<float> >. You must insert this extra space in all stream definitions that contain a type that encloses another type. For example: stream<sequence<integer> >.
Copyright © 2013
Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.