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

            var buffer =
                new BasicConsumerByteBuffer(0, textResponse.Length + 1024)
                .Put(Converters.TextToBytes(textResponse)).Flip();

            RespondWith(context, buffer, closeFollowing);
        }
コード例 #2
0
 public void RespondWith(RequestResponseContext context, IConsumerByteBuffer buffer)
 {
     if (!this.actor.IsStopped)
     {
         Action <IResponseSenderChannel> consumer = __ => __.RespondWith(context, buffer);
         if (this.mailbox.IsPreallocated)
         {
             this.mailbox.Send(this.actor, consumer, null, RespondWithRepresentation2);
         }
         else
         {
             this.mailbox.Send(new LocalMessage <IResponseSenderChannel>(this.actor, consumer,
                                                                         RespondWithRepresentation2));
         }
     }
     else
     {
         this.actor.DeadLetters.FailedDelivery(new DeadLetter(this.actor, RespondWithRepresentation2));
     }
 }
コード例 #3
0
 public void Abandon(RequestResponseContext context)
 {
     if (!this.actor.IsStopped)
     {
         Action <IResponseSenderChannel> consumer = __ => __.Abandon(context);
         if (this.mailbox.IsPreallocated)
         {
             this.mailbox.Send(this.actor, consumer, null, AbandonRepresentation1);
         }
         else
         {
             this.mailbox.Send(
                 new LocalMessage <IResponseSenderChannel>(this.actor, consumer, AbandonRepresentation1));
         }
     }
     else
     {
         this.actor.DeadLetters.FailedDelivery(new DeadLetter(this.actor, AbandonRepresentation1));
     }
 }
コード例 #4
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));
     }
 }
コード例 #5
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));
     }
 }
コード例 #6
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));
     }
 }
コード例 #7
0
 public void RespondWith(RequestResponseContext context, IConsumerByteBuffer buffer, bool closeFollowing)
 {
     ((Context)context).QueueWritable(buffer);
     ((Context)context).RequireExplicitClose(!closeFollowing);
 }
コード例 #8
0
 public void RespondWith(RequestResponseContext context, IConsumerByteBuffer buffer) =>
 RespondWith(context, buffer, false);
コード例 #9
0
 public void Abandon(RequestResponseContext context) => ((Context)context).Close();
コード例 #10
0
 public void RespondWith(RequestResponseContext <Socket> context, IConsumerByteBuffer buffer) =>
 ((Context)context).QueueWritable(buffer);