IBMStreams / streamsx.topology

Develop streaming applications for IBM Streams in Python, Java & Scala.
http://ibmstreams.github.io/streamsx.topology
Apache License 2.0
29 stars 43 forks source link

execution context: Make submission time parameters available without serializing the parameter callable #2488

Closed ghost closed 4 years ago

ghost commented 4 years ago

When you create a submission time parameter in Python and want to use this in an operator Callable/Lambda expression, you would do following:

threshold = topology.create_submission_parameter('threshold', 100);

# s is some stream of integers
s = ...
s = s.filter(lambda v : v > threshold())

Current restriction is, that these callables (here threshold) cannot be used in functions. Instead of passing around callable instances you may want to use submission time values in callables similar the way to anyone can make a call to get at environment variables.

ghost commented 4 years ago

One solution would be to implement a function streamsx.ec.get_submission_time_value(name, type_=None)

The restrictions and the interworking with submission time parameters created with SPL expressions must be documented.