/// <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); }
/// <summary> /// Initializes the CBS link. /// </summary> /// <param name="connection">The connection in which to create the links.</param> public AmqpCbsLink(AmqpConnection connection) { this.connection = connection ?? throw new ArgumentNullException(nameof(connection)); this.linkFactory = new FaultTolerantAmqpObject <RequestResponseAmqpLink>( timeout => this.CreateCbsLinkAsync(timeout), link => CloseLink(link)); this.connection.AddExtension(this); }