shikokuchuo/mirai

Trouble using nextget("cv")

wlandau opened this issue · 1 comments

In #78 (reply in thread), 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

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