Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

메시지 흐름을 다이어그램과 일치시키는것은 쉬운일은 아닙니다. 보통 메시지 전송 툴(Akka/Netty/Kafka등등)들이 사용하기 어렵고

코드가 복잡해진다고 하면 이것을 일치하는것은 더 어려운일이나,  AKKA의 Actor은 UML툴과 비교적 쉽게 일치가 됩니다. 

또한 자신의방식 혹은 팀과 공유할수 있는 방식으로 코드와 다이어그램을 자신의 방식으로 다이어그램으로 정리하여 일치시키려는 노력은 중요합니다. 

게임로직은 API가 단순하게 DB를 저장시키고 조회를 하는것이 아니기 때문입니다.  때문에 문서 자동화가 어렵기때문입니다.   

ActorPath를 통한 메시지 전송

Code Block
languagejava
themeEmacs
private ActorRef findTableByID(int tableID) throws Exception {
    String tableActorPath = "/user/lobby/table-"+tableID;
    ActorSelection tableSelect = this.getContext().actorSelection(tableActorPath);
    FiniteDuration duration = FiniteDuration.create(1, TimeUnit.SECONDS);
    Future<ActorRef> fut = tableSelect.resolveOne(duration);
    ActorRef tableActor = Await.result(fut, duration);
    return tableActor;
}

...