Versions Compared

Key

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

콘솔 APP 프로젝트 생성

실습은 콘솔 APP로 진행예정입니다.

Image Added


LIB 설치 

사용하고 싶은 프로젝트에 nuget을 이용하여 라이브러리를 설정합니다.

Akka - Akka.Remote - Akka.Cluster

필요한것만 설치가능하지만, Cluster는 Remote와 Akka 기반 패키지를 모두 포함함으로

Cluster를 설치합니다.

...

nuget을 통한 라이브러리 설치: 


패키지 관리자를 통한 설치

Code Block
PM> install-package Akka
PM> install-package Akka.Remote


AkkaSystem을 사용하기 위한 최초 코드작성

Code Block
languagec#
using System;
using Akka.Actor;
using Akka.Routing;

namespace ServiceA
{
    class Program
    {
        static void Main(string[] args)
        {
            ConsoleKeyInfo cki;
            Console.CancelKeyPress += new ConsoleCancelEventHandler(myHandler);            
            using (ActorSystem system = ActorSystem.Create("ServiceA"))
            {
				//Actor의 시스템 준비 완료
                
                while (true)
                {                    
                    // 메인 어플리케이션 종료방지를 위한코드 ( ctrl+x 종료 )
                    cki = Console.ReadKey(true);
                    if (cki.Key == ConsoleKey.X) break;
                }
            }
        }

        protected static void myHandler(object sender, ConsoleCancelEventArgs args)
        {
            args.Cancel = true;
        }
    }
}





App.config

.net의 어플리케이션 설정과 호환가능:  특이한 형태의 설정으로  JAVA와 설정방식호환  

...