Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested progression info #36

Open
HenrikBengtsson opened this issue May 9, 2019 · 1 comment
Open

Nested progression info #36

HenrikBengtsson opened this issue May 9, 2019 · 1 comment

Comments

@HenrikBengtsson
Copy link
Collaborator

In order to support refined progression info at the top level, aggregators should/could relay nested info that provide info on the current step and any nested steps, e.g. step = c(2, 23). Same for messages and max_steps.

@HenrikBengtsson
Copy link
Collaborator Author

HenrikBengtsson commented Jun 9, 2019

Capture-gather-and-release progressions:

library(progressr)
with_progress({
p <- progressor(3L)
## Listen for progressions and if detected relay in 10 microsteps summing up to one.
## otherwise signal one step at the end
p(y1 <- slow_sum(1:10))
## Listen for progressions and if detected relay in 5 microsteps summing up to one,
## otherwise signal one step at the end
p(y2 <- slow_sum(5:1))
## Listen for progressions, but nothing signaled, so a one-step progression is signaled at the end
p(z <- y1 + y2)
})

But, it would be nice if we could write this as:

with_progress({
p <- progressor(3L)
## Listen for progressions and if detected relay in 10 microsteps summing up to one.
## otherwise signal one step at the end
p("listen")
y1 <- slow_sum(1:10)

## Listen for progressions and if detected relay in 5 microsteps summing up to one,
## otherwise signal one step at the end
p("listen")
y2 <- slow_sum(5:1)

## Listen for progressions, but nothing signaled, so a one-step progression is signaled at the end
p("listen")
z <- y1 + y2
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant