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



##########
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:
       So it reduced duplicating alot of code. Also due to 2.0 api if someone 
sets a completion listener but still sends using async then the callback should 
be called. I dont expect people to do that but as its possible then need to 
handle it




----------------------------------------------------------------
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:
[email protected]


Reply via email to