Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public static OrderProcessor GetInstance()
        {
            if (instance == null)
            {
                lock (instanceLock)
                {
                    if (instance == null)
                    {
                        instance = new OrderProcessor();
                    }
                }
            }

            return(instance);
        }