Example #1
0
 @Test
 public void demonstrateTestActorRef() {
   final Props props = Props.create(MyActor.class);
   final TestActorRef<MyActor> ref = TestActorRef.create(system, props, "testA");
   final MyActor actor = ref.underlyingActor();
   assertTrue(actor.testMe());
 }
  @Override
  public void create() {
    stage = new Stage();
    Gdx.input.setInputProcessor(stage);

    MyActor myActor = new MyActor();

    MoveToAction action = Actions.action(MoveToAction.class);
    action.setPosition(100, 0);
    action.setDuration(2f);
    action.setInterpolation(Interpolation.linear);
    myActor.addAction(action);
    stage.addActor(myActor);
  }
Example #3
0
  public static void main(String[] args) throws Exception {
    final Properties props = new Properties();
    props.setProperty("galaxy.nodeId", Integer.toString(nodeId));
    props.setProperty("galaxy.port", Integer.toString(7050 + nodeId));
    props.setProperty("galaxy.slave_port", Integer.toString(8050 + nodeId));

    final Grid grid = Grid.getInstance(null, props);
    grid.goOnline();

    final MyActor actor = new MyActor();
    actor.spawnThread();
    actor.register(ACTOR_NAME);

    final ActorRef<HelloMessage> ref = ActorRegistry.getActor(ACTOR_NAME);

    try {
      RequestReplyHelper.call(ref, new HelloMessage());
    } catch (Throwable e) {
      log.error("====>", e);
    }

    grid.cluster().goOffline();
  }