private void ThreadSendsChannelMessage(Action sendMessage, int expectedMsgTypeId)
        {
            sendMessage();

            AssertReadsOneMessage((msgTypeId, buffer, index, length) =>
            {
                PublicationMessageFlyweight publicationMessage = new PublicationMessageFlyweight();
                publicationMessage.Wrap(buffer, index);
                Assert.That(msgTypeId, Is.EqualTo(expectedMsgTypeId));
                Assert.That(publicationMessage.Channel(), Is.EqualTo(CHANNEL));
                Assert.That(publicationMessage.StreamId(), Is.EqualTo(STREAM_ID));
            });
        }
Beispiel #2
0
        private void ThreadSendsChannelMessage(Action sendMessage, int expectedMsgTypeId)
        {
            sendMessage();

            AssertReadsOneMessage((msgTypeId, buffer, index, length) =>
            {
                PublicationMessageFlyweight publicationMessage = new PublicationMessageFlyweight();
                publicationMessage.Wrap(buffer, index);
                Assert.That(msgTypeId, Is.EqualTo(expectedMsgTypeId));
                Assert.That(publicationMessage.Channel(), Is.EqualTo(CHANNEL));
                Assert.That(publicationMessage.StreamId(), Is.EqualTo(STREAM_ID));
            });
        }
Beispiel #3
0
        public DriverProxy(IRingBuffer toDriverCommandBuffer)
        {
            if (toDriverCommandBuffer == null)
            {
                throw new ArgumentNullException(nameof(toDriverCommandBuffer));
            }

            _toDriverCommandBuffer = toDriverCommandBuffer;

            _publicationMessage.Wrap(_buffer, 0);
            _subscriptionMessage.Wrap(_buffer, 0);

            _correlatedMessage.Wrap(_keepaliveBuffer, 0);
            _removeMessage.Wrap(_buffer, 0);

            _clientId = toDriverCommandBuffer.NextCorrelationId();
        }
Beispiel #4
0
        public DriverProxy(IRingBuffer toDriverCommandBuffer, long clientId)
        {
            if (toDriverCommandBuffer == null)
            {
                throw new ArgumentNullException(nameof(toDriverCommandBuffer));
            }

            _toDriverCommandBuffer = toDriverCommandBuffer;

            _publicationMessage.Wrap(_buffer, 0);
            _subscriptionMessage.Wrap(_buffer, 0);

            _correlatedMessage.Wrap(_buffer, 0);
            _removeMessage.Wrap(_buffer, 0);
            _destinationMessage.Wrap(_buffer, 0);

            _correlatedMessage.ClientId(clientId);
        }