Ejemplo n.º 1
0
        /// <summary>
        /// Processes a received flow performative and start receiving from the
        /// message source if required.
        /// </summary>
        /// <param name="flowContext">Context of the received flow performative.</param>
        public override void OnFlow(FlowContext flowContext)
        {
            lock (this.syncRoot)
            {
                if (this.receiving || this.link.Credit == 0)
                {
                    return;
                }

                this.receiving = true;
            }

            Task.Factory.StartNew(o => ((SourceLinkEndpoint)o).ReceiveAsync(), this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes a received flow performative and start receiving from the
        /// message source if required.
        /// </summary>
        /// <param name="flowContext">Context of the received flow performative.</param>
        public override void OnFlow(FlowContext flowContext)
        {
            lock (this.syncRoot)
            {
                if (this.receiving || this.link.Credit == 0)
                {
                    return;
                }

                this.receiving = true;
            }

            Task.Factory.StartNew(o => ((SourceLinkEndpoint)o).ReceiveAsync(), this);
        }
Ejemplo n.º 3
0
 public override void OnFlow(FlowContext flowContext)
 {
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Processes a received flow performative. A sending endpoint should send messages per the requested
 /// message count. A receiving endpoint may receive a flow if the sender may want to request for credit
 /// or send custom properties.
 /// </summary>
 /// <param name="flowContext">Context of the received flow performative.</param>
 public abstract void OnFlow(FlowContext flowContext);
Ejemplo n.º 5
0
 /// <summary>
 /// Processes a received flow performative. A sending endpoint should send messages per the requested
 /// message count. A receiving endpoint may receive a flow if the sender may want to request for credit
 /// or send custom properties.
 /// </summary>
 /// <param name="flowContext">Context of the received flow performative.</param>
 public abstract void OnFlow(FlowContext flowContext);
Ejemplo n.º 6
0
 public override void OnFlow(FlowContext flowContext)
 {
     for (int i = 0; i < flowContext.Messages; i++)
     {
         var message = new Message("test message");
         flowContext.Link.SendMessage(message, message.Encode());
     }
 }
Ejemplo n.º 7
0
 public override void OnFlow(FlowContext flowContext)
 {
     for (int i = 0; i < flowContext.Messages; i++)
     {
         var message = new Message("Hello!");
         message.Properties = new Properties() { Subject = "Welcome Message" };
         flowContext.Link.SendMessage(message, null);
     }
 }
Ejemplo n.º 8
0
 public override void OnFlow(FlowContext flowContext)
 {
     for (int i = 0; i < flowContext.Messages; i++)
     {
         var message = new Message("Hello!");
         message.Properties = new Properties() { Subject = "Message" + Interlocked.Increment(ref this.id) };
         flowContext.Link.SendMessage(message);
     }
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Processes a received flow performative.
 /// </summary>
 /// <param name="flowContext">Context of the received flow performative.</param>
 public override void OnFlow(FlowContext flowContext)
 {
 }
Ejemplo n.º 10
0
 public override void OnFlow(FlowContext flowContext)
 {
     Interlocked.Add(ref this.credit, flowContext.Messages);
 }