Does resolve(..., result=TRUE) work? #680
-
I guess I'm not sure what the 'result' option in resolve is used for? Consider this example:
From the doc, it seemed to me that they should produce the same output, but they don't. The resolve function returns copies of the futures (regardless of result=TRUE or result=FALSE). ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi. Sorry, this one slipped. Also, |
Beta Was this translation helpful? Give feedback.
Hi. Sorry, this one slipped.
resolve(x)
always returnsx
. Withresult = FALSE
,resolve()
queries the parallel worker for whether the future has been resolved or not, and it does so as quick as possible with minimal extra overhead. However, sometimes it can be more performant to collect the results back from the parallel worker at the same time. For instance, when there are multiple concurrent futures, we can collect the results while waiting for other futures to resolve, which is faster than waiting for all futures to resolve and then collect the results. That is whatresult = TRUE
achieves. I've updatedhelp("resolve")
to clarify this.Also,
value(ans)
in your example, whereans
is a lis…