source_stream module¶
-
source_stream.
source_stream
(output_stream, number_of_values, time_period, func, **kwargs)[source]¶ Periodically appends a value to output_stream. The values appended are obtained by calling the function func and passing it keyword arguments.
If number_of_values is non-negative, then it is the maximum number of values inserted into output_stream. If number_of_values is negative then values are appended to output_stream forever.
If time_period is 0 then number_of_values must be non-negative; in this case all the values are appended to output_stream when source_stream is called.
Parameters: output_stream: Stream
(Could also be a list.) The stream to which values are appended. (Note: Appending messages to a list forever will cause memory
overflow.)
number_of_values: int
time_period: int or float, nonnegative
The time between successive appends to output_stream.
func: function
The return value of this function is appended to output_stream.