albertosantini / node-rio

Integration with Rserve, a TCP/IP server for R framework
https://github.com/albertosantini/node-conpa
MIT License
176 stars 35 forks source link

Sync execution #40

Closed xerviami closed 6 years ago

xerviami commented 6 years ago

Hi,

Is there a way to call Rio in a sync way ? (preventing the remaining node code to execute before R computation ends)

Thank you Xavier

albertosantini commented 6 years ago

Generally speaking, the usual way to handle a a response of a remote call is via an asynchronous call.

So you can execute your code, at the end of R computation, in the callback or in the "then" part of the Promise; you have both interfaces.

Nowadays you can wrap your logic using an async/await approach.