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
Related to #81. As of c41e4a0, crew uses environments for controller$queue and controller$list to store mirai tasks. This makes controller$push() and controller$collect() much faster, but controller$pop() is very slow.
When names() is called, I am simply trying to extract an element of controller$results without knowing its name in advance. I cannot call controller$results[[1L]] because the object is an environment.
Last I checked there were packages like datastructures and hashmap which implement proper data structures, but these and others like it seem to be removed from CRAN. But that is the sort of thing I would like to do.
But maybe there is a way I can sneakily implement controller$results as a linked list / stack. For each task I push to controller$results, I can give it the ID of the task to pop after itself, and I can keep track of the current head of the stack with a single character string.
The text was updated successfully, but these errors were encountered:
No, only controller$results is actually a stack, which is fine. Once the tasks finish, collection should be quick anyway. If it's first-in/first-out for tasks known to already be resolved, maybe that's not so bad.
Related to #81. As of c41e4a0,
crew
uses environments forcontroller$queue
andcontroller$list
to storemirai
tasks. This makescontroller$push()
andcontroller$collect()
much faster, butcontroller$pop()
is very slow.When
names()
is called, I am simply trying to extract an element ofcontroller$results
without knowing its name in advance. I cannot callcontroller$results[[1L]]
because the object is an environment.crew/R/crew_controller.R
Lines 447 to 450 in c41e4a0
Last I checked there were packages like
datastructures
andhashmap
which implement proper data structures, but these and others like it seem to be removed from CRAN. But that is the sort of thing I would like to do.But maybe there is a way I can sneakily implement
controller$results
as a linked list / stack. For each task I push tocontroller$results
, I can give it the ID of the task to pop after itself, and I can keep track of the current head of the stack with a single character string.The text was updated successfully, but these errors were encountered: