Ejemplo n.º 1
0
 /// <summary>
 /// 发送消息
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="busClient"></param>
 /// <param name="message"></param>
 /// <returns></returns>
 public static async Task SendAsync <T>(this IBusClient busClient, T message) where T : class
 {
     await busClient.SendAsync(null, message);
 }
 public Task <TResult> SendAsync(TCommand command, CancellationToken cancellationToken = default)
 => _busClient.SendAsync <TCommand, string, TResult>(command.IdentityKey, command);
Ejemplo n.º 3
0
 /// <summary>
 /// 发送消息
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="busClient"></param>
 /// <param name="queue"></param>
 /// <param name="message"></param>
 public static void Send <T>(this IBusClient busClient, string queue, T message) where T : class
 {
     busClient.SendAsync(queue, message).Wait();
 }