コード例 #1
0
        public void RequestOrderReport_RetrieveResults_Successful()
        {
            IList <object[]> report = null;
            var dataEventReceived   = false;

            if (_reportingEngineClient != null)
            {
                var manualReportEvent = new ManualResetEvent(false);

                // Hook Event
                _reportingEngineClient.OrderReportReceivedEvent += delegate(IList <object[]> obj)
                {
                    report            = obj;
                    dataEventReceived = true;
                    manualReportEvent.Set();
                };

                // Create Parameters for Report
                Dictionary <OrderParameters, string> arguments = new Dictionary <OrderParameters, string>();

                arguments.Add(OrderParameters.OrderSide, "BUY");
                arguments.Add(OrderParameters.OrderStatus, "CANCELLED,OPEN");
                arguments.Add(OrderParameters.OrderSize, "13");

                // Request Order Report
                _reportingEngineClient.RequestOrderReport(arguments);

                manualReportEvent.WaitOne(3000, false);
            }

            Assert.IsNotNull(report);
            Assert.IsTrue(dataEventReceived, "Report Event");
            Assert.Greater(report.Count, 0, "Return Count");
        }
コード例 #2
0
 /// <summary>
 /// Called when a publisher has committed an event to the <see cref="T:Disruptor.RingBuffer`1"/>
 /// </summary>
 /// <param name="data">Data committed to the <see cref="T:Disruptor.RingBuffer`1"/></param><param name="sequence">Sequence number committed to the <see cref="T:Disruptor.RingBuffer`1"/></param><param name="endOfBatch">flag to indicate if this is the last event in a batch from the <see cref="T:Disruptor.RingBuffer`1"/></param>
 public void OnNext(Dictionary <OrderParameters, string> data, long sequence, bool endOfBatch)
 {
     // Send Request to Client
     _reportingEngineClient.RequestOrderReport(data);
 }