Difference in collecting output of executing external command in Groovy

后端 未结 1 2006
天命终不由人
天命终不由人 2021-01-12 17:20

Following code gets stuck(which I think is blocking I/O) many times (works some time).

def static executeCurlCommand(URL){
    def url = \"curl \" + URL;
            


        
相关标签:
1条回答
  • 2021-01-12 17:52

    The first approach fills a buffer up and then blocks waiting for more room to write output to.

    The second approach streams output from the buffer via a separate thread as the process is running, so the process doesn't block.

    0 讨论(0)
提交回复
热议问题