/// <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); }
/// <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); }
public override void OnFlow(FlowContext flowContext) { }
/// <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);
/// <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);
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()); } }
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); } }
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); } }
/// <summary> /// Processes a received flow performative. /// </summary> /// <param name="flowContext">Context of the received flow performative.</param> public override void OnFlow(FlowContext flowContext) { }
public override void OnFlow(FlowContext flowContext) { Interlocked.Add(ref this.credit, flowContext.Messages); }