Exemple #1
0
 public void GetHome()
 {
     #region GetHomeAsync (TPL)
     IQueueingService    queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     Task <HomeDocument> task            = queueingService.GetHomeAsync(CancellationToken.None);
     #endregion
 }
 public void GetNodeHealth()
 {
     #region GetNodeHealthAsync (TPL)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     Task task = queueingService.GetNodeHealthAsync(CancellationToken.None);
     #endregion
 }
 public async Task GetNodeHealthAsyncAwait()
 {
     #region GetNodeHealthAsync (await)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     await queueingService.GetNodeHealthAsync(CancellationToken.None);
     #endregion
 }
 public void GetHome()
 {
     #region GetHomeAsync (TPL)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     Task<HomeDocument> task = queueingService.GetHomeAsync(CancellationToken.None);
     #endregion
 }
 public async Task GetHomeAsyncAwait()
 {
     #region GetHomeAsync (await)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     HomeDocument createdQueue = await queueingService.GetHomeAsync(CancellationToken.None);
     #endregion
 }
Exemple #6
0
 public void GetNodeHealth()
 {
     #region GetNodeHealthAsync (TPL)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     Task             task            = queueingService.GetNodeHealthAsync(CancellationToken.None);
     #endregion
 }
 public async Task DeleteQueueAsyncAwait()
 {
     #region DeleteQueueAsync (await)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     QueueName queueName = new QueueName("ExampleQueue");
     await queueingService.DeleteQueueAsync(queueName, CancellationToken.None);
     #endregion
 }
 public void CreateQueue()
 {
     #region CreateQueueAsync (TPL)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     QueueName queueName = new QueueName("ExampleQueue");
     Task<bool> task = queueingService.CreateQueueAsync(queueName, CancellationToken.None);
     #endregion
 }
Exemple #9
0
 public void DeleteQueue()
 {
     #region DeleteQueueAsync (TPL)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     QueueName        queueName       = new QueueName("ExampleQueue");
     Task             task            = queueingService.DeleteQueueAsync(queueName, CancellationToken.None);
     #endregion
 }
Exemple #10
0
        public async Task GetHomeAsyncAwait()
        {
            #region GetHomeAsync (await)
            IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
            HomeDocument     createdQueue    = await queueingService.GetHomeAsync(CancellationToken.None);

            #endregion
        }
Exemple #11
0
        public async Task GetNodeHealthAsyncAwait()
        {
            #region GetNodeHealthAsync (await)
            IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
            await queueingService.GetNodeHealthAsync(CancellationToken.None);

            #endregion
        }
Exemple #12
0
        public async Task DeleteQueueAsyncAwait()
        {
            #region DeleteQueueAsync (await)
            IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
            QueueName        queueName       = new QueueName("ExampleQueue");
            await queueingService.DeleteQueueAsync(queueName, CancellationToken.None);

            #endregion
        }
Exemple #13
0
        public async Task ListQueuesAsyncAwait()
        {
            #region ListQueuesAsync (await)
            IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
            ReadOnlyCollectionPage <CloudQueue> queuesPage = await queueingService.ListQueuesAsync(null, null, true, CancellationToken.None);

            ReadOnlyCollection <CloudQueue> queues = await queuesPage.GetAllPagesAsync(CancellationToken.None, null);

            #endregion
        }
Exemple #14
0
            public QueueProperties(CloudQueuesProvider provider, CloudQueue queue)
            {
                if (provider == null)
                    throw new ArgumentNullException("provider");
                if (queue == null)
                    throw new ArgumentNullException("queue");

                _provider = provider;
                _queue = queue;
            }
Exemple #15
0
 public void ListQueues()
 {
     #region ListQueuesAsync (TPL)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     Task <ReadOnlyCollectionPage <CloudQueue> > queuesPageTask = queueingService.ListQueuesAsync(null, null, true, CancellationToken.None);
     Task <ReadOnlyCollection <CloudQueue> >     queuesTask     =
         queuesPageTask
         .ContinueWith(task => task.Result.GetAllPagesAsync(CancellationToken.None, null))
         .Unwrap();
     #endregion
 }
 /// <summary>
 /// Creates an instance of <see cref="IQueueingService"/> for testing using
 /// the <see cref="OpenstackNetSetings.TestIdentity"/>.
 /// </summary>
 /// <returns>An instance of <see cref="IQueueingService"/> for integration testing.</returns>
 private IQueueingService CreateProvider()
 {
     var provider = new CloudQueuesProvider(Bootstrapper.Settings.TestIdentity, Bootstrapper.Settings.DefaultRegion, Guid.NewGuid(), false, null);
     provider.ConnectionLimit = 80;
     return provider;
 }
 public async Task ListQueuesAsyncAwait()
 {
     #region ListQueuesAsync (await)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     ReadOnlyCollectionPage<CloudQueue> queuesPage = await queueingService.ListQueuesAsync(null, null, true, CancellationToken.None);
     ReadOnlyCollection<CloudQueue> queues = await queuesPage.GetAllPagesAsync(CancellationToken.None, null);
     #endregion
 }
 public override void CloseConnection()
 {
     provider = null;
     identity = null;
 }
 public RackspaceCloudQueues(string keyId, string username)
 {
     identity = new CloudIdentity() { APIKey = keyId, Username = username };
     provider = new CloudQueuesProvider(identity, location, Guid.NewGuid(), false, null);
 }
 public void SetLocation(string location)
 {
     this.location = location;
     provider = new CloudQueuesProvider(identity, location, Guid.NewGuid(), false, null);
 }
        /// <summary>
        /// Creates an instance of <see cref="IQueueingService"/> for testing using
        /// the <see cref="OpenstackNetSetings.TestIdentity"/>.
        /// </summary>
        /// <returns>An instance of <see cref="IQueueingService"/> for integration testing.</returns>
        private IQueueingService CreateProvider()
        {
            var provider = new CloudQueuesProvider(Bootstrapper.Settings.TestIdentity, Bootstrapper.Settings.DefaultRegion, Guid.NewGuid(), false, null);
            provider.BeforeAsyncWebRequest +=
                (sender, e) =>
                {
                    Console.WriteLine("{0} (Request) {1} {2}", DateTime.Now, e.Request.Method, e.Request.RequestUri);
                };
            provider.AfterAsyncWebResponse +=
                (sender, e) =>
                {
                    Console.WriteLine("{0} (Result {1}) {2}", DateTime.Now, e.Response.StatusCode, e.Response.ResponseUri);
                };

            provider.ConnectionLimit = 80;
            return provider;
        }
 private CloudQueueNode CreateQueueNode(CloudQueuesProvider provider, CloudQueue queue)
 {
     return new CloudQueueNode(provider, queue);
 }
 public void ListQueues()
 {
     #region ListQueuesAsync (TPL)
     IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
     Task<ReadOnlyCollectionPage<CloudQueue>> queuesPageTask = queueingService.ListQueuesAsync(null, null, true, CancellationToken.None);
     Task<ReadOnlyCollection<CloudQueue>> queuesTask =
         queuesPageTask
         .ContinueWith(task => task.Result.GetAllPagesAsync(CancellationToken.None, null))
         .Unwrap();
     #endregion
 }