class_docstr: Helper class for tracking the status of many in-flight actor tasks.
class_docstr_tok: ["Helper","class","for","tracking","the","status","of","many","in-flight","actor","tasks","."]
docstr: Notify that some workers may be removed.
docstr_tok: ["Notify","that","some","workers","may","be","removed","."]
code: def reset_workers(self, workers):
      """Notify that some workers may be removed."""
      for obj_ref, ev in self._tasks.copy().items():
          if ev not in workers:
              del self._tasks[obj_ref]
              del self._objects[obj_ref]
  
      # We want to keep the same deque reference so that we don't suffer from
      # stale references in generators that are still in flight
      for _ in range(len(self._fetching)):
          ev, obj_ref = self._fetching.popleft()
          if ev in workers:
              # Re-queue items that are still valid
              self._fetching.append((ev, obj_ref))
  
file_path: ray/python/ray/rllib/utils/actors.py
imports: from collections import defaultdict, deque
  import logging
  import platform
  from typing import Any, Dict, List, Optional, Sequence, Tuple, Type
  import ray
  from ray.actor import ActorClass, ActorHandle
label_desc: Use image node_id 5 for calling the TaskPool obj's underlying member method code with example usage: obj.reset_workers(workers) without return types