public virtual async Task RespondAsync(object message, Type messageType, IPipe <SendContext> sendPipe) { if (message == null) { throw new ArgumentNullException(nameof(message)); } if (messageType == null) { throw new ArgumentNullException(nameof(messageType)); } if (sendPipe == null) { throw new ArgumentNullException(nameof(sendPipe)); } if (ResponseAddress != null) { var endpoint = await GetSendEndpoint(ResponseAddress).ConfigureAwait(false); await SendEndpointConverterCache.Send(endpoint, message, messageType, new ResponsePipe(this, sendPipe), CancellationToken) .ConfigureAwait(false); } else { await Publish(message, messageType, new ResponsePipe(this, sendPipe), CancellationToken).ConfigureAwait(false); } }
public Task Send(object message, CancellationToken cancellationToken) { if (message == null) { throw new ArgumentNullException(nameof(message)); } var messageType = message.GetType(); return(SendEndpointConverterCache.Send(this, message, messageType, cancellationToken)); }
public Task Send(object message, Type messageType, IPipe <SendContext> pipe, CancellationToken cancellationToken) { if (message == null) { throw new ArgumentNullException(nameof(message)); } if (messageType == null) { throw new ArgumentNullException(nameof(messageType)); } if (pipe == null) { throw new ArgumentNullException(nameof(pipe)); } return(SendEndpointConverterCache.Send(this, message, messageType, pipe, cancellationToken)); }