private void SendMessages()
 {
     while (true)
     {
         Task.Delay(2000).Wait();
         _messageBus.Broadcast <object>("message id", "message content", new CustomEndpointProtocol());
     }
 }
Esempio n. 2
0
        private async Task SendMessages()
        {
            while (true)
            {
                await Task.Delay(1000);

                _messageBus.Broadcast <object>("message", "message content", DefaultProtocol.Instance);
            }
        }
Esempio n. 3
0
        private void Broadcast()
        {
            var data = new byte[100];
            var rnd  = new Random();

            rnd.NextBytes(data);
            var stream = new MemoryStream(data);

            _messageBus.Broadcast(MessageId, "empty message", stream, StreamCallback, new SimpleCustomProtocol(), null);
            _logger.Warning($"Sent stream with hash {stream.GetHashCode()}");
        }