Closed chalup closed 10 years ago
Few thoughts on this issue:
So I propose the following API: 0 to n transform()
calls, that might be followed by lazy()
call, which make all of the previous transforms lazy, follwed by 0 to n wrap()
calls. Here is the list of possible usage:
transform().transform().transform()
- eager transformations
transform().transform().transform().lazy()
- lazy transformations
transform().transform().transform().wrap().wrap().wrap()
- eager transformations followed by eager wraps
transform().transform().transform().lazy().wrap().wrap().wrap()
- lazy transformations followed by eager wraps
wrap().wrap().wrap()
- eager wraps
@partition what do you think?
Implemented in #26
Currently transform() is always evaluated lazily, but the eager evaluation in background thread is also a valid scenario. You can work around this by wrapping the result with a function iterating over LazyList returned by transform, but I think this should be supported directly by the API.
I think the concepts of lazy/eager evaluation and single row/whole result should be decoupled.