public Task <Outcome> DisposeMessageAsync(ArraySegment <byte> deliveryTag, Outcome outcome, bool batchable, TimeSpan timeout) { return(TaskHelpers.CreateTask( (c, s) => this.BeginDisposeMessage(deliveryTag, outcome, batchable, timeout, c, s), a => ((ReceivingAmqpLink)a.AsyncState).EndDisposeMessage(a), this)); }
public Task <AmqpMessage> RequestAsync(AmqpMessage request, TimeSpan timeout) { return(TaskHelpers.CreateTask( (c, s) => ((RequestResponseAmqpLink)s).BeginRequest(request, timeout, c, s), (r) => ((RequestResponseAmqpLink)r.AsyncState).EndRequest(r), this)); }
public Task <DateTime> SendTokenAsync(ICbsTokenProvider tokenProvider, Uri namespaceAddress, string audience, string resource, string[] requiredClaims, TimeSpan timeout) { return(TaskHelpers.CreateTask( (c, s) => this.BeginSendToken( tokenProvider, namespaceAddress, audience, resource, requiredClaims, timeout, c, s), (a) => this.EndSendToken(a))); }
/// <summary> /// Constructs a new instance /// </summary> public AmqpCbsLink(AmqpConnection connection) { this.connection = connection ?? throw new ArgumentNullException(nameof(connection)); this.linkFactory = new FaultTolerantAmqpObject <RequestResponseAmqpLink>( t => TaskHelpers.CreateTask <RequestResponseAmqpLink>((c, s) => this.BeginCreateCbsLink(t, c, s), this.EndCreateCbsLink), link => CloseLink(link)); this.connection.Extensions.Add(this); }
public Task <AmqpMessage> ReceiveMessageAsync(TimeSpan timeout) { return(TaskHelpers.CreateTask( (c, s) => ((ReceivingAmqpLink)s).BeginReceiveMessage(timeout, c, s), (a) => { AmqpMessage message; ((ReceivingAmqpLink)a.AsyncState).EndReceiveMessage(a, out message); return message; }, this)); }
/// <summary> /// Constructs a new instance /// </summary> public AmqpCbsLink(AmqpConnection connection) { if (connection == null) { throw Fx.Exception.ArgumentNull("connection"); } this.connection = connection; this.FaultTolerantLink = new FaultTolerantAmqpObject <RequestResponseAmqpLink>( t => TaskHelpers.CreateTask <RequestResponseAmqpLink>((c, s) => this.BeginCreateCbsLink(t, c, s), this.EndCreateCbsLink), this.CloseLink); this.connection.Extensions.Add(this); }