Exemplo n.º 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
 }
Exemplo n.º 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
 }
Exemplo n.º 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
 }
Exemplo n.º 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
        }
Exemplo n.º 11
0
        public async Task GetNodeHealthAsyncAwait()
        {
            #region GetNodeHealthAsync (await)
            IQueueingService queueingService = new CloudQueuesProvider(identity, region, clientId, internalUrl, identityProvider);
            await queueingService.GetNodeHealthAsync(CancellationToken.None);

            #endregion
        }
Exemplo n.º 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
        }
Exemplo n.º 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
        }
Exemplo n.º 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;
            }
Exemplo n.º 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
 }
Exemplo n.º 18
0
 public override void CloseConnection()
 {
     provider = null;
     identity = null;
 }
Exemplo n.º 19
0
 public RackspaceCloudQueues(string keyId, string username)
 {
     identity = new CloudIdentity() { APIKey = keyId, Username = username };
     provider = new CloudQueuesProvider(identity, location, Guid.NewGuid(), false, null);
 }
Exemplo n.º 20
0
 public void SetLocation(string location)
 {
     this.location = location;
     provider = new CloudQueuesProvider(identity, location, Guid.NewGuid(), false, null);
 }
Exemplo n.º 21
0
        /// <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;
        }
Exemplo n.º 22
0
 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
 }