Esempio n. 1
0
        public static WorkerPool <T> Instance(Action <T> handler, ILogger <EchoServerApplication> logger)
        {
            if (_instance == null)
            {
                _instance = new WorkerPool <T>(handler, logger);
            }

            return(_instance);
        }
Esempio n. 2
0
 public EchoConnectionHandler(ConnectionContext connection, WorkerPool <WorkItem> pool, ILogger <EchoServerApplication> logger)
 {
     _connection = connection;
     _pool       = pool;
     _logger     = logger;
 }
Esempio n. 3
0
 public EchoServerApplication(ILogger <EchoServerApplication> logger)
 {
     _logger = logger;
     _pool   = WorkerPool <WorkItem> .Instance(HandleMessage, _logger);
 }