another question :
Is there a way to stop a tube execution ?
Either brute force or with resuming option ...
Regards
The documentation should probably be made clearer about that, but it
does say:
----------
2. Once launched, you are on the event track page with progression
and messages.
* To add messages there, you can call message_callback in your nodes
* To update progression, use progression_callback in the producer.
----------
That means you have access to two functions in code components:
message_callback and progression_callback (they are automatically
available in the local scope of your code component).
For example, you can do the following (off the top of my head, might not
be perfect) :
----------
items = session.query(MyModel)
total = items.count()
for index, item in enumerate(items):
progression_callback((index+1)/total)
yield item
----------
You might want to update the progression every X items (with X > 1) to
avoid impacting too much the performance of the tube. ;)
The progression_callback and message_callback functions are documented
here:
http://pyfproject.org/documentation/contents/modules/componentized/base_components/#base-code-component
--
Mathieu
Its clear and simple :) I like it.
Regards
> here:http://pyfproject.org/documentation/contents/modules/componentized/ba...
>
> --
> Mathieu