The actor's main work loop
11828
def _run(self):
        ''''''
      
        while self._is_running:
            yield from self._task()

        # Signal that the loop has finished.
        self._run_complete.set_result(True)
519954
def get_actor(self, aid, check_monitor=True):
        '''
        '''
        aid = actor_identity(aid)
        return self._concurrency.get_actor(self, aid,
                                           check_monitor=check_monitor)
577463
@Override
    public void show() {
        final Stage stage = getStage();
        stage.getRoot().clearChildren();
        LmlUtilities.appendActorsToStage(stage, actors);
    }
715496
def get_actor(self, name):
        
        return next((x for x in self.actors if x.name == name), None)
257622
def run
      loop do
        break if Actor.current.dead? || @websocket.closed? || @server.dead?
        message = try_read_websocket
        handle_websocket_message(message) if message.present?
      end
    end
369240
def scenario1_man():
  
  for loop in range(1, 50):
    do_action(my_char, rest)
    do_action(my_char, think)
    do_action(my_char, study)
    do_action(my_char, tinker)
421847
function(ms) {
    var axes = this._cam.mainAxes();
    var intervals = [ new utils.Range(), new utils.Range(), new utils.Range() ];
    this.forEach(function(obj) {
      if (!obj.visible()) {
        return;
      }
      obj.updateProjectionIntervals(axes[0], axes[1], axes[2], intervals[0],
                                    intervals[1], intervals[2]);
    });
    this._fitToIntervals(axes, intervals, ms);
  }
88451
public void run() {
        pollThread = Thread.currentThread();
        if ( underway )
            return;
        underway = true;
        try {
            int count = 1;
            while( count > 0 ) { // as long there are messages, keep sending them
                count = onePoll();
                if ( sendJobs.size() > 0 ) {
                    if ( count > 0 ) {
                        int debug =1;
                    }
                    else {
                        if ( remoteRefCounter == 0 ) // no remote actors registered
                        {
                            Actor.current().delayed(100, this); // backoff massively
                        } else {
                            Actor.current().delayed(1, this); // backoff a bit (remoteactors present, no messages)
                        }
                    }
                } else {
                    // no schedule entries (== no clients)
                    Actor.current().delayed(100, this );
                }
            }
        } finally {
            underway = false;
        }
    }
1167296
def do(actor, targets)
    return if targets.empty?
    #If next item is a collection of prototypes, copy them all in at once.
    if prototypes[@prototype_index].respond_to?(:each)
      prototypes[@prototype_index].each do |prototype|
        actor.environment.add_object(generate_child(actor, prototype, targets[@target_index]))
      end
    #Otherwise copy the single prototype.
    else
      targets[@target_index].environment.add_object(generate_child(actor, prototypes[@prototype_index], targets[@target_index]))
    end
    #Move to next target and prototype group, wrapping to start of array if need be.
    @target_index = (@target_index + 1) % targets.length
    @prototype_index = (@prototype_index + 1) % prototypes.length
  end
222469
def declare_actor(self, actor):  # pragma: no cover
        
        self.emit_before("declare_actor", actor)
        self.declare_queue(actor.queue_name)
        self.actors[actor.actor_name] = actor
        self.emit_after("declare_actor", actor)
51149
def select(actor, targets)
    targets.find_all {|target| actor.size >= target.size}
  end
24262
def create_mailbox(self, actor, loop):
        ''''''
        client = MailboxClient(actor.monitor.address, actor, loop)
        loop.call_soon_threadsafe(self.hand_shake, actor)
        return client
272966
async def main(loop):
    """"""
    pyvlx = PyVLX('pyvlx.yaml', loop=loop)
    # Alternative:
    # pyvlx = PyVLX(host="192.168.2.127", password="velux123", loop=loop)

    # Runing scenes:
    await pyvlx.load_scenes()
    await pyvlx.scenes["All Windows Closed"].run()

    # Changing position of windows:
    await pyvlx.load_nodes()
    await pyvlx.nodes['Bath'].open()
    await pyvlx.nodes['Bath'].close()
    await pyvlx.nodes['Bath'].set_position(Position(position_percent=45))

    # Changing of on-off switches:
    # await pyvlx.nodes['CoffeeMaker'].set_on()
    # await pyvlx.nodes['CoffeeMaker'].set_off()

    # You can easily rename nodes:
    # await pyvlx.nodes["Window 10"].rename("Window 11")

    await pyvlx.disconnect()
1249325
def check_actors(self, actors):
        
        super(Flow, self).check_actors(actors)
        actor = self.first_active
        if (actor is not None) and not base.is_source(actor):
            raise Exception("First active actor is not a source: " + actor.full_name)
407963
def actors(self, actors):
        
        if actors is None:
            actors = self.default_actors()
        self.check_actors(actors)
        self.config["actors"] = actors
1135364
def manage_actors(self, monitor, stop=False):
        '''
        '''
        alive = 0
        if self.managed_actors:
            for aid, actor in list(self.managed_actors.items()):
                alive += self.manage_actor(monitor, actor, stop)
        return alive
1207956
public static void keepWithinStage (Actor actor) {
		Stage stage = actor.getStage();
		if (stage == null) {
			throw new IllegalStateException("keepWithinStage cannot be used on Actor that doesn't belong to any stage. ");
		}
		keepWithinStage(actor.getStage(), actor);
	}