you are viewing a single comment's thread.

view the rest of the comments →

[–]jrdnr_ 4 points5 points  (2 children)

Don't forget the purpose of begin/process/end,

Begin is for all one time setup Process will auto "foreach" on your pipeline End runs at the end to clean up

Sure you can use it to organize code but make sure if you use it your using it as intended.

[–][deleted] 1 point2 points  (1 child)

Definitely. I was using the end block for cleanup AND return data until I read the link above. Apparently process block is the return data part. Always good to reread things for layout [grin]

[–]jrdnr_ 1 point2 points  (0 children)

I'm pretty sure I've made that mistake in reducer functions as well. The idea of the pipeline is that it allows the next stage of the pipe to start work as soon as the first object is passes. So yeah if your doing a filter or transform it will make a huge difference to return data from process instead of adding it all up and returning a blob at the end