shikokuchuo / mirai

mirai - Minimalist Async Evaluation Framework for R
https://shikokuchuo.net/mirai/
GNU General Public License v3.0
193 stars 10 forks source link

Trouble using nextget("cv") #82

Closed wlandau closed 1 year ago

wlandau commented 1 year ago

In https://github.com/shikokuchuo/mirai/discussions/78#discussioncomment-7148551, we had discussed cv_value(nextget("cv")) as a way to measure resolved tasks. But when I tried it out in a simple example, I found cv_value(nextget("cv")) stayed at 0. Am I missing something?

library(mirai)
packageVersion("mirai")
#> ‘0.10.2’
library(nanonext)
packageVersion("nanonext")
#> ‘0.10.0.9018’
daemons(1, "ws://127.0.0.1:5700")
task1 <- mirai(1)
task2 <- mirai(2)
launch_local(url = "ws://127.0.0.1:5700")
Sys.sleep(5)
daemons()
#> $connections
#> [1] 1
#> 
#> $daemons
#>                     i online instance assigned complete
#> ws://127.0.0.1:5700 1      1        1        2        2
cv_value(nextget("cv"))
#> [1] 0
wlandau commented 1 year ago

Ah, I forgot .signal = TRUE in mirai(). Sorry about that.