code: def spawn_actors(self, monitor):
          '''Spawn new actors if needed.
          '''
          to_spawn = monitor.cfg.workers - len(self.managed_actors)
          if monitor.cfg.workers and to_spawn > 0:
              for _ in range(to_spawn):
                  monitor.spawn(f spawn_actors(self, monitor):
          '''Spawn new actors if needed.
          '''
          to_spawn = monitor.cfg.workers - len(self.managed_actors)
          if monitor.cfg.workers and to_spawn > 0:
              for _ in range(to_spawn):
                  monitor.spawn()
docs: Spawn new actors if needed.