mulesoft-labs / data-weave-cli

DataWeave CLI and Native Library
BSD 3-Clause "New" or "Revised" License
97 stars 31 forks source link

deferred=true does not write to file #40

Closed yudiell closed 2 years ago

yudiell commented 2 years ago

When you set the deferred=true in the dw script it outputs nothing.

Example: curl "https://api.github.com/repos/mulesoft/mule/commits?per_page=5" | dw > response.json "output application/json deferred=true --- payload"

Your response is greatly appreciated.

uip-robot-zz commented 2 years ago

Git2Gus App is installed but the .git2gus/config.json doesn't exist.

machaval commented 2 years ago

Hi thanks, deferred is currently not supported in the cli because it doesn't make sense in this context. Why are you trying to use it?

yudiell commented 2 years ago

Hello @machaval, Thanks for the reply. I am trying to use it for memory management.

machaval commented 2 years ago

So deferred doesn't apply on the cli because what it doesn't is it defers the output until is required by a consumer of the output. But in your case if you output to a file or the standard output is the same. It wan't make any difference in terms of the memory management.

yudiell commented 2 years ago

I am trying to replicate this scenario. dw

So I don't run into this: dw_outofmemmory

yudiell commented 2 years ago

Please disregard. I did not realize that the output is binary and therefore we will be unable to do transformations. Thank you.