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
In the develop branchprogressr (>= 0.7.0), the progressor() function must not be created in the global environment. This was necessary in order to be able to automatically inject an on.exit() call that terminates the progressor when exiting a function, local(), etc. This approach won't work in the global environment. Because of this, progressor() now produce an error if one attempts to call it from the global environment. This helps to protect against an incomplete/interrupted progressor from blocking all future progressors.
However, it might be possible to get around this too. First, I think this is only a problem when the global progress handler is enabled. So, if there is an active progressor in the global environment and we try to create another progressor()from the global environment, then we know that the previous one is no longer of interest and we could terminate that one before creating the new one, e.g.
p1<- progressor(3)
p1() # incomplete
p1() # still incompletep2<- progressor(4) # here can terminate p1()
EDIT 2021-02-28: The above is now is implemented for the next release (0.8.0).
This leaves the case where we try to use progress updates from another function, e.g.
p1<- progressor(3)
p1() # incomplete
p1() # still incomplete
slow_sum(1:3)
In this case, the progressor created inside slow_sum() is not created in the global environment. How can we make sure it is ok to terminate p1() in this case? Can we distinguish this case from:
p1<- progressor(3)
for (kkin1:2) {
p1()
slow_sum(1:3)
}
p1() # complete here
?
I think the answer is: we can't.
I'll leave this issue open for a while to fully digest this idea. Maybe something else will come to me/us
The text was updated successfully, but these errors were encountered:
In
the develop branchprogressr (>= 0.7.0), theprogressor()
function must not be created in the global environment. This was necessary in order to be able to automatically inject anon.exit()
call that terminates the progressor when exiting a function,local()
, etc. This approach won't work in the global environment. Because of this,progressor()
now produce an error if one attempts to call it from the global environment. This helps to protect against an incomplete/interrupted progressor from blocking all future progressors.However, it might be possible to get around this too. First, I think this is only a problem when the global progress handler is enabled. So, if there is an active progressor in the global environment and we try to create another
progressor()
from the global environment, then we know that the previous one is no longer of interest and we could terminate that one before creating the new one, e.g.EDIT 2021-02-28: The above is now is implemented for the next release (0.8.0).
This leaves the case where we try to use progress updates from another function, e.g.
In this case, the progressor created inside
slow_sum()
is not created in the global environment. How can we make sure it is ok to terminatep1()
in this case? Can we distinguish this case from:?
I think the answer is: we can't.
I'll leave this issue open for a while to fully digest this idea. Maybe something else will come to me/us
The text was updated successfully, but these errors were encountered: