private void SendMessages() { while (true) { Task.Delay(2000).Wait(); _messageBus.Broadcast <object>("message id", "message content", new CustomEndpointProtocol()); } }
private async Task SendMessages() { while (true) { await Task.Delay(1000); _messageBus.Broadcast <object>("message", "message content", DefaultProtocol.Instance); } }
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()}"); }