Re-allow creation of progressor in the global environment
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
Direzione di ricerca
Partire dal punto di ingresso progressor() e riprodurre gli esempi dell’ambiente globale, inclusi i casi di slow_sum() descritti qui. L’issue non indica file o test, e la sua domanda irrisolta è se un progressor globale esistente possa essere terminato in sicurezza da un’altra funzione. Il lavoro sarebbe completato dopo aver stabilito questo comportamento e aver convalidato la decisione con test appropriati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
In the develop branch progressr (>= 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 incomplete
p2 <- 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 (kk in 1: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
- Lingua principale
- R
- Stelle
- 299
- Fork
- 11
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di futureverse/progressr
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 63/100
futureverse/progressr#198 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
futureverse/progressr#197 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
futureverse/progressr#195 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
futureverse/progressr#191 ·
-
question
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
futureverse/progressr#155 · 5 commenti ·
Tutte le issue di futureverse/progressr
Issue simili
-
Affects Web App documentation PRIORITY LOW
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
hubverse-org/hubCI#36 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Release 1.4.0 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
pharmaverse/pharmaverseadam#170 ·