Exemple #1
0
        public void RespondWith(RequestResponseContext context, object response, bool closeFollowing)
        {
            var textResponse = response.ToString();

            if (!string.IsNullOrEmpty(textResponse))
            {
                var buffer =
                    new BasicConsumerByteBuffer(0, textResponse.Length + 1024)
                    .Put(Converters.TextToBytes(textResponse)).Flip();

                RespondWith(context, buffer, closeFollowing);
            }
        }
Exemple #2
0
 public void Abandon(RequestResponseContext context)
 {
     if (!_actor.IsStopped)
     {
         Action <IResponseSenderChannel> cons8585439 = __ => __.Abandon(context);
         if (_mailbox.IsPreallocated)
         {
             _mailbox.Send(_actor, cons8585439, null, AbandonRepresentation1);
         }
         else
         {
             _mailbox.Send(
                 new LocalMessage <IResponseSenderChannel>(_actor, cons8585439,
                                                           AbandonRepresentation1));
         }
     }
     else
     {
         _actor.DeadLetters?.FailedDelivery(new DeadLetter(_actor, AbandonRepresentation1));
     }
 }
Exemple #3
0
 public void RespondWith(RequestResponseContext context,
                         Message.IConsumerByteBuffer buffer, bool closeFollowing)
 {
     if (!_actor.IsStopped)
     {
         Action <IResponseSenderChannel> cons829071244 = __ =>
                                                         __.RespondWith(context, buffer, closeFollowing);
         if (_mailbox.IsPreallocated)
         {
             _mailbox.Send(_actor, cons829071244, null, RespondWithRepresentation3);
         }
         else
         {
             _mailbox.Send(new LocalMessage <IResponseSenderChannel>(_actor,
                                                                     cons829071244, RespondWithRepresentation3));
         }
     }
     else
     {
         _actor.DeadLetters?.FailedDelivery(new DeadLetter(_actor, RespondWithRepresentation3));
     }
 }
Exemple #4
0
 public void RespondWith(RequestResponseContext context, object response,
                         bool closeFollowing)
 {
     if (!_actor.IsStopped)
     {
         Action <IResponseSenderChannel> cons1528567494 = __ =>
                                                          __.RespondWith(context, response, closeFollowing);
         if (_mailbox.IsPreallocated)
         {
             _mailbox.Send(_actor, cons1528567494, null, RespondWithRepresentation4);
         }
         else
         {
             _mailbox.Send(new LocalMessage <IResponseSenderChannel>(_actor,
                                                                     cons1528567494, RespondWithRepresentation4));
         }
     }
     else
     {
         _actor.DeadLetters?.FailedDelivery(new DeadLetter(_actor, RespondWithRepresentation4));
     }
 }
Exemple #5
0
 public void RespondWith(RequestResponseContext context, IConsumerByteBuffer buffer, bool closeFollowing)
 {
     ((Context)context).QueueWritable(buffer);
     ((Context)context).RequireExplicitClose(!closeFollowing);
 }
Exemple #6
0
 public void RespondWith(RequestResponseContext context, IConsumerByteBuffer buffer) =>
 RespondWith(context, buffer, false);
Exemple #7
0
 public void Abandon(RequestResponseContext context) => ((Context)context).Close();