public async Task <MsgOp> RequestAsync(string subject, string body, int?timeoutMs = null) { ThrowIfDisposed(); EnsureArg.IsNotNullOrWhiteSpace(subject, nameof(subject)); EnsureArg.IsNotNullOrWhiteSpace(body, nameof(body)); return(await DoRequestAsync(subject, NatsEncoder.GetBytes(body), timeoutMs).ConfigureAwait(false)); }
internal static ReadOnlySpan <byte> Generate(bool verbose, Credentials credentials, string name) { var opString = GenerateConnectionOpString( verbose, credentials ?? Credentials.Empty, name); return(NatsEncoder.GetBytes(opString).Span); }
public Task <MsgOp> RequestAsync(string subject, string body, CancellationToken cancellationToken = default) => RequestAsync(subject, NatsEncoder.GetBytes(body), cancellationToken);
public Task PubAsync(string subject, string body, string replyTo = null) => PubAsync(subject, NatsEncoder.GetBytes(body), replyTo);
public void Pub(string subject, string body, string replyTo = null) => Pub(subject, NatsEncoder.GetBytes(body), replyTo);
internal static byte[] Generate(string subject, string body, string replyTo = null) => Generate(subject, NatsEncoder.GetBytes(body), replyTo);