Exemple #1
0
        /// <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);
        }
Exemple #2
0
        /// <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);
        }