Пример #1
0
        public MessageServer(string hostname)
        {
            if (string.IsNullOrWhiteSpace(hostname))
            {
                throw new ArgumentNullException(nameof(hostname));
            }

            RegisterCommandHandlers();
            orderProcessor = OrderProcessor.GetInstance();

            IRPCServer rpcServer = new RabbitRPCServer(hostname);

            rpcServer.RegisterReceiverCallback(ReceivedCallback);
        }
Пример #2
0
        public static OrderProcessor GetInstance()
        {
            if (instance == null)
            {
                lock (instanceLock)
                {
                    if (instance == null)
                    {
                        instance = new OrderProcessor();
                    }
                }
            }

            return(instance);
        }