Exemple #1
0
 private static void WritePub(ref NatsWriter writer, PubOperation op)
 {
     writer.WriteString($"PUB {op.Subject} ");
     if (!string.IsNullOrEmpty(op.ReplyTo))
     {
         writer.WriteString(op.ReplyTo);
         writer.WriteString(" ");
     }
     writer.WriteInt(op.Data.Length);
     writer.Write(CRLF);
     writer.Write(op.Data.Span);
     writer.Write(CRLF);
 }
Exemple #2
0
 private static void WriteSub(ref NatsWriter writer, SubOperation op)
 {
     writer.WriteString($"SUB {op.Subject}");
     if (!string.IsNullOrEmpty(op.QueueGroup))
     {
         writer.WriteString(" ");
         writer.WriteString(op.QueueGroup);
     }
     writer.WriteString(" ");
     writer.WriteString(op.Sid);
     writer.Write(CRLF);
 }
Exemple #3
0
 private static void WriteConnect(ref NatsWriter writer, ConnectOperation op)
 {
     writer.WriteString($"CONNECT ");
     writer.WriteJson(op);
     writer.Write(CRLF);
 }