Would it be possible to add a method to the WorkQueue class that allows to remove a callback from the queue? This probably means changing the return value of schedule_work to some sort of handle if you want to properly reference callbacks that have been queued more than once.
Note that identical cannot be used to search through the queue:
> f <- \() 1
> g <- \() 1
> identical(f, g)
[1] TRUE
PS: Although maybe using ignore.srcref = FALSE is sufficient:
Would it be possible to add a method to the
WorkQueue
class that allows to remove a callback from the queue? This probably means changing the return value ofschedule_work
to some sort of handle if you want to properly reference callbacks that have been queued more than once.Note that
identical
cannot be used to search through the queue:PS: Although maybe using
ignore.srcref = FALSE
is sufficient: