Skip to content

debugging code inside %dofuture% #693

Closed Answered by HenrikBengtsson
iagomosqueira asked this question in Q&A
Discussion options

You must be logged in to vote

The problem you're experiencing is similar to using browser() or debug() when calling a function with capture.output(). The output produced by browser() and debug() is captured, recorded internally, to be outputted at a later time. See HenrikBengtsson/Wishlist-for-R#90 for an example of this problem. This is also what happens internally when parallelizing using futures.

The solution is to tell the future framework to capture and output at the same time. This can be done by using:

plan(sequential, split = TRUE)

The default is split = FALSE.

See Section 'Interactive debugging' in the blog post 'future 1.20.1 - The Future Just Got a Bit Brighter' on 2020-11-06 for more explanations.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by iagomosqueira
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants