Developing Apama Applications > Developing Apama Applications in EPL > Working with Streams and Stream Queries > Defining streams > Terminating streams
Terminating streams
If a stream goes out of scope it continues to exist until the monitor instance terminates or the stream is explicitly terminated in some fashion. Streams are not garbage-collected. This means it is possible to leak streams, thereby consuming memory and potentially performing unnecessary computation, if you do not explicitly terminate steams.
To terminate a stream, call the quit() method on a stream variable that refers to the stream you want to terminate. For example:
stream<integer> foo := all A();
...
foo.quit();
This might also terminate connected streams. See Stream network lifetime. It is also possible to terminate connected streams by quitting a stream listener.
Copyright © Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its Subsidiaries and or/its Affiliates and/or their licensors.
Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.