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
The following code shows that when the task execution results in an error, that error is not bubbled up to the main session. Instead, the expected behavior should be throwing the error in the main session to make the users aware that something went wrong.
# Creat e specification instance.specification<-Specification$new()
# Select cores and type.specification$set_cores(4)
specification$set_type("psock")
# Create an asynchronous backend instance.backend<-AsyncBackend$new()
# Start the backend.backend$start(specification)
# Run a task.backend$sapply(1:10, function(x) x+1)
# Get the output.backend$get_output(wait=TRUE)
# Run a task that throws an error.backend$sapply(1:10, function(x) stop("Some unexpected error."))
# Get the output.backend$get_output(wait=TRUE)
# Stop the backend.backend$stop()
This is not the case for the SyncBackend class.
# Create a synchronous backend instance.backend<-SyncBackend$new()
# Start the backend.backend$start(specification)
# Run a task that throws an error.backend$sapply(1:10, function(x) stop("Some unexpected error."))
# Stop the backend.backend$stop()
Perhaps, in AsyncBackend, instead of setting the .output field right away (i.e., see below), we could first check to see if the session encountered errors and, if so, raise them to the main session.
The following code shows that when the task execution results in an error, that error is not bubbled up to the main session. Instead, the expected behavior should be throwing the error in the main session to make the users aware that something went wrong.
This is not the case for the
SyncBackend
class.Perhaps, in
AsyncBackend
, instead of setting the.output
field right away (i.e., see below), we could first check to see if the session encountered errors and, if so, raise them to the main session.parabar/R/AsyncBackend.R
Lines 249 to 253 in 6880ebc
The text was updated successfully, but these errors were encountered: