예제 #1
0
        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));
        }
예제 #2
0
        internal static ReadOnlySpan <byte> Generate(bool verbose, Credentials credentials, string name)
        {
            var opString = GenerateConnectionOpString(
                verbose,
                credentials ?? Credentials.Empty,
                name);

            return(NatsEncoder.GetBytes(opString).Span);
        }
예제 #3
0
 public Task <MsgOp> RequestAsync(string subject, string body, CancellationToken cancellationToken = default)
 => RequestAsync(subject, NatsEncoder.GetBytes(body), cancellationToken);
예제 #4
0
 public Task PubAsync(string subject, string body, string replyTo = null)
 => PubAsync(subject, NatsEncoder.GetBytes(body), replyTo);
예제 #5
0
 public void Pub(string subject, string body, string replyTo = null)
 => Pub(subject, NatsEncoder.GetBytes(body), replyTo);
예제 #6
0
 internal static byte[] Generate(string subject, string body, string replyTo = null)
 => Generate(subject, NatsEncoder.GetBytes(body), replyTo);