You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've finally landed on a good project for experimenting with mirai and I've been super impressed.
All was going well until I started getting errors in some code I was calling with everywhere(). Not any issue with mirai directly - it turns out a web request I needed to make from each node was starting to error due to some server downtime. To debug the issues in everywhere(), I had to re-write it as single mirai() call to inspect the result.
It would be helpful if everywhere() returned a list of mirai objects similar to mirai_map. This would allow me to build some checks into my scripts for situations where successful execution relies on external factors.
daemons(2)
ms<- everywhere({
do_flaky_web_request()
"success"
})
ms[]
ms[[1]]$data#> [1] "success"ms[[2]]$data#> 'miraiError' chr Error in do_flaky_web_request: server timeout
The text was updated successfully, but these errors were encountered:
# modify `everywhere()` to return `vec`everywhere<-mirai::everywhere
body(everywhere) <- bquote({ .(body(everywhere)); invisible(vec) })
ms<-mirai::collect_mirai(everywhere({
do_flaky_web_request()
"success"
}))
if (any(is_error<- vapply(ms, mirai::is_mirai_error, logical(1L)))) {
stop("issues encountered during daemon setup")
}
This let me terminate early when anything goes wrong. In practice, I can also expose things like individual node error messages and stack traces stored in the mirai error objects.
Although modifying a function body is a last resort, I was impressed by how simple the change was.
Thanks Doug. I'm persuaded of the benefits of your request.
Leave this with me - it may take some time as I might be updating the underlying implementation (currently comprised of mirai calls) - and I don't want to be changing the API too often.
I've finally landed on a good project for experimenting with
mirai
and I've been super impressed.All was going well until I started getting errors in some code I was calling with
everywhere()
. Not any issue withmirai
directly - it turns out a web request I needed to make from each node was starting to error due to some server downtime. To debug the issues ineverywhere()
, I had to re-write it as singlemirai()
call to inspect the result.It would be helpful if
everywhere()
returned a list ofmirai
objects similar tomirai_map
. This would allow me to build some checks into my scripts for situations where successful execution relies on external factors.The text was updated successfully, but these errors were encountered: