示例#1
0
        public void Start()
        {
            _processor = new FeedProcessor(OnValidQuote, OnInvalidQuote);
            _processor.Start();

            _snapshotServer = new NetMqSnapshotServer(_snapshotAddress, CreateSnapshot);
            _snapshotServer.Start();

            _publisher = new NetMqPublisher(_publisherAddress);
            _publisher.Start();

            _gateway = new NetMqPushAcceptor(_gatewayAddress);
            _gateway.Subscribe(Constants.QuotesTopicName, message =>
            {
                //TODO: try use protobuff
                var rawQuotes = BinarySerializer<IEnumerable<Quote>>.DeSerializeFromByteArray(message);
                _processor.ProcessQuotes(rawQuotes);
            });
            _gateway.Start();
        }
示例#2
0
        public void Start()
        {
            //Debug.WriteLine(TimerResolution.SetResolution(500));

            _processor = new FeedProcessor(OnValidQuote, OnInvalidQuote);
            _processor.Start();

            _snapshotServer = new NetMqSnapshotServer(_snapshotAddress, CreateSnapshot);
            _snapshotServer.Start();

            _publisher = new NetMqPublisher(_publisherAddress);
            _publisher.Start();

            _gateway = new NetMqPushAcceptor(_gatewayAddress);
            _gateway.Subscribe(Constants.QuotesTopicName, message =>
            {
                //TODO: try use protobuff
                var rawQuotes = BinarySerializer <IEnumerable <Quote> > .DeSerializeFromByteArray(message);
                _processor.ProcessQuotes(rawQuotes);
            });
            _gateway.Start();
        }