You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2020/04/20 19:45:58 UTC

[GitHub] [activemq-nms-amqp] Havret commented on a change in pull request #56: AMQNET-637 NMS 2.0 - Add NMS 2.0 method implementations.

Havret commented on a change in pull request #56:
URL: https://github.com/apache/activemq-nms-amqp/pull/56#discussion_r411644196



##########
File path: src/NMS.AMQP/NmsSession.cs
##########
@@ -396,8 +450,20 @@ public void AcknowledgeIndividual(AckType ackType, InboundMessageDispatch envelo
             Connection.Acknowledge(envelope, ackType).ConfigureAwait(false).GetAwaiter().GetResult();
         }
 
-        public void Send(NmsMessageProducer producer, IDestination destination, IMessage original, MsgDeliveryMode deliveryMode,
-            MsgPriority priority, TimeSpan timeToLive, bool disableMessageId, bool disableMessageTimestamp)
+        public void Send(NmsMessageProducer producer, IDestination destination, IMessage original,
+            MsgDeliveryMode deliveryMode,
+            MsgPriority priority, TimeSpan timeToLive, bool disableMessageId, bool disableMessageTimestamp, TimeSpan deliveryDelay, CompletionListener completionListener)
+        {
+            Task task = SendAsync(producer, destination, original, deliveryMode, priority, timeToLive, disableMessageId,
+                disableMessageTimestamp, deliveryDelay, completionListener);
+            if (completionListener == null)
+            {
+                task.ConfigureAwait(false).GetAwaiter().GetResult();
+            }
+        }
+
+        public Task SendAsync(NmsMessageProducer producer, IDestination destination, IMessage original, MsgDeliveryMode deliveryMode,

Review comment:
       This is not the correct way of handling async sends. We should have either SendAsync that accepts callback and returns void or without Callback but returning Task. In this form it doesn't make sense. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org