/// <summary> /// Send message /// </summary> /// <param name="message"></param> /// <returns></returns> private Task SendAsync(DiscoveryMessageModel message) { return(Try.Async(() => _events.SendAsync( Encoding.UTF8.GetBytes(JsonConvertEx.SerializeObject(message)), ContentTypes.DiscoveryMessage))); }
/// <summary> /// Send message /// </summary> /// <param name="message"></param> private void Send(DiscoveryMessageModel message) { _processor.TrySchedule(() => SendAsync(message)); }