Inheritance: Microsoft.Azure.Amqp.Framing.Performative
コード例 #1
0
ファイル: Controller.cs プロジェクト: Azure/azure-amqp
 public IAsyncResult BeginDeclare(TimeSpan timeout, AsyncCallback callback, object state)
 {
     AmqpTrace.Provider.AmqpLogOperationInformational(this, TraceOperation.Execute, "BeginDeclare");
     Declare declare = new Declare();
     AmqpMessage message = Controller.CreateCommandMessage(declare);
     return this.sendLink.BeginSendMessage(message, this.GetDeliveryTag(), AmqpConstants.NullBinary, timeout, callback, state);
 }
コード例 #2
0
ファイル: Controller.cs プロジェクト: xinchen10/azure-amqp
        /// <summary>
        /// Declares a transaction.
        /// </summary>
        /// <returns>A task that returns a transaction id when it completes.</returns>
        public async Task <ArraySegment <byte> > DeclareAsync()
        {
            AmqpTrace.Provider.AmqpLogOperationInformational(this, TraceOperation.Execute, "BeginDeclare");
            Declare declare = new Declare();

            AmqpMessage   message       = Controller.CreateCommandMessage(declare);
            DeliveryState deliveryState = await Task <DeliveryState> .Factory.FromAsync(
                this.controllerLink.BeginSendMessage(message, this.GetDeliveryTag(), AmqpConstants.NullBinary, this.operationTimeout, null, null),
                this.controllerLink.EndSendMessage).ConfigureAwait(false);

            this.ThrowIfRejected(deliveryState);
            AmqpTrace.Provider.AmqpLogOperationInformational(this, TraceOperation.Execute, "EndDeclare");
            return(((Declared)deliveryState).TxnId);
        }