From e5c7745e4308e4438e5bc3bf4b8d3dd7d9435c64 Mon Sep 17 00:00:00 2001 From: Rajeev Vokkarne Date: Tue, 25 Aug 2015 13:41:42 -0700 Subject: [PATCH] Update to use SB 3.0.1 nuget package --- Framework/Framework.csproj | 4 +- Framework/TaskOrchestrationDispatcher.cs | 2 +- Framework/TrackingDispatcher.cs | 2 +- Framework/Utils.cs | 39 -------------------- Framework/packages.config | 2 +- FrameworkUnitTests/FrameworkUnitTests.csproj | 4 +- FrameworkUnitTests/packages.config | 2 +- 7 files changed, 8 insertions(+), 47 deletions(-) diff --git a/Framework/Framework.csproj b/Framework/Framework.csproj index bedb9f8f2..64c9695b8 100644 --- a/Framework/Framework.csproj +++ b/Framework/Framework.csproj @@ -55,9 +55,9 @@ ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll - + False - ..\packages\WindowsAzure.ServiceBus.2.2.4.0\lib\net40-full\Microsoft.ServiceBus.dll + ..\packages\WindowsAzure.ServiceBus.3.0.1\lib\net45-full\Microsoft.ServiceBus.dll ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/Framework/TaskOrchestrationDispatcher.cs b/Framework/TaskOrchestrationDispatcher.cs index cd2af8666..5e38389e0 100644 --- a/Framework/TaskOrchestrationDispatcher.cs +++ b/Framework/TaskOrchestrationDispatcher.cs @@ -797,7 +797,7 @@ protected override async Task SafeReleaseWorkItem(SessionWorkItem workItem) { try { - await Task.Factory.FromAsync(workItem.Session.BeginClose, workItem.Session.EndClose, null); + await workItem.Session.CloseAsync(); } catch (Exception ex) { diff --git a/Framework/TrackingDispatcher.cs b/Framework/TrackingDispatcher.cs index 1d1145cab..231a4c720 100644 --- a/Framework/TrackingDispatcher.cs +++ b/Framework/TrackingDispatcher.cs @@ -255,7 +255,7 @@ protected override async Task SafeReleaseWorkItem(SessionWorkItem workItem) { try { - await Task.Factory.FromAsync(workItem.Session.BeginClose, workItem.Session.EndClose, null); + await workItem.Session.CloseAsync(); } catch (Exception ex) { diff --git a/Framework/Utils.cs b/Framework/Utils.cs index d93243169..bd69026eb 100644 --- a/Framework/Utils.cs +++ b/Framework/Utils.cs @@ -14,7 +14,6 @@ namespace DurableTask { using System; - using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.IO.Compression; @@ -400,44 +399,6 @@ public static T SyncExecuteWithRetries(Func retryAction, string sessionId, return retVal; } - public static Task ReceiveAsync(this QueueClient client, TimeSpan timeout) - { - return Task.Factory.FromAsync(client.BeginReceive, client.EndReceive, - timeout, null); - } - - public static Task> ReceiveBatchAsync(this MessageSession session, int messageCount) - { - return Task.Factory.FromAsync>(session.BeginReceiveBatch, - session.EndReceiveBatch, - messageCount, null); - } - - public static Task AcceptMessageSessionAsync(this QueueClient client, TimeSpan timeout) - { - return Task.Factory.FromAsync(client.BeginAcceptMessageSession, - client.EndAcceptMessageSession, - timeout, null); - } - - public static Task SendBatchAsync(this QueueClient queueClient, IEnumerable messages) - { - var tcs = new TaskCompletionSource(); - queueClient.BeginSendBatch(messages, ar => - { - try - { - queueClient.EndSendBatch(ar); - tcs.SetResult(null); - } - catch (Exception exception) - { - tcs.SetException(exception); - } - }, null); - return tcs.Task; - } - public static string SerializeCause(Exception originalException, DataConverter converter) { if (originalException == null) diff --git a/Framework/packages.config b/Framework/packages.config index 95ca1c28e..ed9b24a50 100644 --- a/Framework/packages.config +++ b/Framework/packages.config @@ -7,6 +7,6 @@ - + \ No newline at end of file diff --git a/FrameworkUnitTests/FrameworkUnitTests.csproj b/FrameworkUnitTests/FrameworkUnitTests.csproj index bc5c41355..84bf39481 100644 --- a/FrameworkUnitTests/FrameworkUnitTests.csproj +++ b/FrameworkUnitTests/FrameworkUnitTests.csproj @@ -56,9 +56,9 @@ ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll True - + False - ..\packages\WindowsAzure.ServiceBus.2.2.4.0\lib\net40-full\Microsoft.ServiceBus.dll + ..\packages\WindowsAzure.ServiceBus.3.0.1\lib\net45-full\Microsoft.ServiceBus.dll ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net40\Microsoft.WindowsAzure.Configuration.dll diff --git a/FrameworkUnitTests/packages.config b/FrameworkUnitTests/packages.config index 95ca1c28e..ed9b24a50 100644 --- a/FrameworkUnitTests/packages.config +++ b/FrameworkUnitTests/packages.config @@ -7,6 +7,6 @@ - + \ No newline at end of file