• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Queue.CloudQueueClient类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient的典型用法代码示例。如果您正苦于以下问题:C# CloudQueueClient类的具体用法?C# CloudQueueClient怎么用?C# CloudQueueClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CloudQueueClient类属于Microsoft.WindowsAzure.Storage.Queue命名空间,在下文中一共展示了CloudQueueClient类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Run

        public static void Run(string connectionString, bool disableLogging)
        {
            _connectionString = connectionString;
            _storageAccount = CloudStorageAccount.Parse(connectionString);
            _queueClient = _storageAccount.CreateCloudQueueClient();

            try
            {
                TimeSpan azureSDKTime = RunAzureSDKTest();
                TimeSpan webJobsSDKTime = RunWebJobsSDKTest(disableLogging);

                // Convert to ulong because the measurment block does not support other data type
                ulong perfRatio = (ulong)((webJobsSDKTime.TotalMilliseconds / azureSDKTime.TotalMilliseconds) * 100);

                Console.WriteLine("--- Results ---");
                Console.WriteLine("Azure SDK:   {0} ms: ", azureSDKTime.TotalMilliseconds);
                Console.WriteLine("WebJobs SDK: {0} ms: ", webJobsSDKTime.TotalMilliseconds);

                Console.WriteLine("Perf ratio (x100, long): {0}", perfRatio);

                MeasurementBlock.Mark(
                    perfRatio,
                    (disableLogging ? QueueNoLoggingOverheadMetric : QueueLoggingOverheadMetric) + ";Ratio;Percent");
            }
            finally
            {
                Cleanup();
            }
        }
开发者ID:rafaelmtz,项目名称:azure-webjobs-sdk,代码行数:29,代码来源:QueueOverheadPerfTest.cs


示例2: BlobManager

 public BlobManager(string conStr)
 {
     //RoleEnvironment.GetConfigurationSettingValue("UploadCon")
     Storage = CloudStorageAccount.Parse(conStr);
     BlobClient = Storage.CreateCloudBlobClient();
     QueueClient = Storage.CreateCloudQueueClient();
 }
开发者ID:peacecwz,项目名称:AAYazOkuluCloudService,代码行数:7,代码来源:BlobManager.cs


示例3: Run

        public override void Run()
        {
            Trace.TraceInformation("QueueProcessor_WorkerRole entry point called", "Information");
            var queueClient = new CloudQueueClient(this.uri, new StorageCredentials(this.GetQueueSas()));

            var queue = queueClient.GetQueueReference("messagequeue");

            while (true)
            {
                Thread.Sleep(10000);
                Trace.TraceInformation("Working", "Information");

                if (DateTime.UtcNow.AddMinutes(1) >= this.serviceQueueSasExpiryTime)
                {
                    queueClient = new CloudQueueClient(this.uri, new StorageCredentials(this.GetQueueSas()));
                    queue = queueClient.GetQueueReference("messagequeue");
                }

                var msg = queue.GetMessage();

                if (msg != null)
                {
                    Trace.TraceInformation(string.Format("Message '{0}' processed.", msg.AsString));
                    queue.DeleteMessage(msg);
                }
            }
        }
开发者ID:joergjo,项目名称:HOL-GettingStartedWindowsAzureStorage,代码行数:27,代码来源:WorkerRole.cs


示例4: EndToEndTestFixture

        protected EndToEndTestFixture(string rootPath)
        {
            string connectionString = AmbientConnectionStringProvider.Instance.GetConnectionString(ConnectionStringNames.Storage);
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);
            _queueClient = storageAccount.CreateCloudQueueClient();
            _blobClient = storageAccount.CreateCloudBlobClient();

            CreateTestStorageEntities();
            TraceWriter = new TestTraceWriter(TraceLevel.Verbose);

            ScriptHostConfiguration config = new ScriptHostConfiguration()
            {
                RootScriptPath = rootPath,
                TraceWriter = TraceWriter,
                FileLoggingEnabled = true
            };

            HostManager = new ScriptHostManager(config);

            Thread t = new Thread(_ =>
            {
                HostManager.RunAndBlock();
            });
            t.Start();

            TestHelpers.Await(() => HostManager.IsRunning).Wait();
        }
开发者ID:isaacabraham,项目名称:azure-webjobs-sdk-script,代码行数:27,代码来源:EndToEndTestFixture.cs


示例5: Setup

        public void Setup()
        {
            client = CloudStorageAccount.DevelopmentStorageAccount.CreateCloudQueueClient();
            client.ServerTimeout = TimeSpan.FromSeconds(10);
            nativeQueue = client.GetQueueReference(QueueName);

            nativeQueue.CreateIfNotExists();
            nativeQueue.Clear();

            sender = new AzureMessageQueueSender
                        {
                            Client = client,
                            MessageSerializer = new JsonMessageSerializer(new MessageMapper())
                        };

            sender.Init(QueueName, true);

            receiver = new AzureMessageQueueReceiver
            {
                Client = client,
                MessageSerializer = new JsonMessageSerializer(new MessageMapper()),
            };

            receiver.Init(QueueName, true);
        }
开发者ID:afyles,项目名称:NServiceBus,代码行数:25,代码来源:AzureQueueFixture.cs


示例6: GenerateCloudQueueClient

 public static CloudQueueClient GenerateCloudQueueClient()
 {
     Uri baseAddressUri = new Uri(TestBase.TargetTenantConfig.QueueServiceEndpoint);
     CloudQueueClient client = new CloudQueueClient(baseAddressUri, TestBase.StorageCredentials);
     client.AuthenticationScheme = DefaultAuthenticationScheme;
     return client;
 }
开发者ID:nberardi,项目名称:azure-sdk-for-net,代码行数:7,代码来源:TestBase.cs


示例7: configureQueue

        protected virtual void configureQueue(CloudStorageAccount storageAccount)
        {
            // Create the queue client
            this.queueClient = storageAccount.CreateCloudQueueClient();

            this.queue = createQueue(this.queueClient, this.queueName);
        }
开发者ID:NewMediaCenterMoscow,项目名称:UniSocial3,代码行数:7,代码来源:BaseMessageWorker.cs


示例8: CloudQueueClientConstructor

 public void CloudQueueClientConstructor()
 {
     Uri baseAddressUri = new Uri(TestBase.TargetTenantConfig.QueueServiceEndpoint);
     CloudQueueClient queueClient = new CloudQueueClient(baseAddressUri, TestBase.StorageCredentials);
     Assert.IsTrue(queueClient.BaseUri.ToString().StartsWith(TestBase.TargetTenantConfig.QueueServiceEndpoint));
     Assert.AreEqual(TestBase.StorageCredentials, queueClient.Credentials);
 }
开发者ID:Juliako,项目名称:azure-sdk-for-net,代码行数:7,代码来源:CloudQueueClientTest.cs


示例9: AzureQueueController

		public AzureQueueController()
		{
			var credentials = new StorageCredentials(ConfigurationManager.AppSettings["AzureAccountName"], ConfigurationManager.AppSettings["AzureKeyValue"]);
			var azureTableUri = new Uri("https://" + ConfigurationManager.AppSettings["AzureAccountName"] + ".queue.core.windows.net");
			var client = new CloudQueueClient(azureTableUri, credentials);
			_queue = client.GetQueueReference(QueueName);
		}
开发者ID:Neonsonne,项目名称:dbSpeed,代码行数:7,代码来源:AzureQueueController.cs


示例10: Run

        public override void Run()
        {
            // This is a sample worker implementation. Replace with your logic.
            Trace.TraceInformation("QueueProcessor_WorkerRole entry point called", "Information");

            // Initialize the account information
            var storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));

            // retrieve a reference to the messages queue
            var queueClient = new CloudQueueClient(this.uri, new StorageCredentials(this.GetProcessSasForQueues()));
            var queue = queueClient.GetQueueReference("messagequeue");

            while (true)
            {
                Thread.Sleep(10000);
                Trace.TraceInformation("Working", "Information");
                if (queue.Exists())
                {
                    if (DateTime.UtcNow.AddMinutes(1) >= this.serviceQueueSasExpiryTime)
                    {
                        queueClient = new CloudQueueClient(this.uri, new StorageCredentials(this.GetProcessSasForQueues()));
                        queue = queueClient.GetQueueReference("messagequeue");
                    }

                    var msg = queue.GetMessage();

                    if (msg != null)
                    {
                        Trace.TraceInformation(string.Format("Message '{0}' processed.", msg.AsString));
                        queue.DeleteMessage(msg);
                    }
                }
            }
        }
开发者ID:spederiva,项目名称:AzureOss,代码行数:34,代码来源:WorkerRole.cs


示例11: EmailQueue

        public EmailQueue(CloudQueueClient queueClient)
        {
            Guard.NotNull(queueClient, nameof(queueClient));

            this._queueClient = queueClient;

            this._dequeuedMessages = new ConcurrentDictionary<Email, CloudQueueMessage>();
        }
开发者ID:LeagueLogbook,项目名称:Logbook,代码行数:8,代码来源:EmailQueue.cs


示例12: CreateShipQueue

        private void CreateShipQueue(CloudQueueClient queueClient)
        {
            var shipQueueName = CloudConfigurationManager.GetSetting("ShipQueue.Name");

            var queue = queueClient.GetQueueReference(shipQueueName);

            queue.CreateIfNotExists();
        }
开发者ID:jladuval,项目名称:CQRSTemplate,代码行数:8,代码来源:StorageQueues.cs


示例13: AzureStorageQueuesTransport

        /// <summary>
        /// Constructs the transport
        /// </summary>
        public AzureStorageQueuesTransport(CloudStorageAccount storageAccount, string inputQueueName)
        {
            if (storageAccount == null) throw new ArgumentNullException("storageAccount");
            if (inputQueueName == null) throw new ArgumentNullException("inputQueueName");

            _inputQueueName = inputQueueName.ToLowerInvariant();
            _queueClient = storageAccount.CreateCloudQueueClient();
        }
开发者ID:geffzhang,项目名称:Rebus,代码行数:11,代码来源:AzureStorageQueuesTransport.cs


示例14: QueueHelper

        public QueueHelper(string storageAccountConnectionString)
            : base(storageAccountConnectionString)
        {

            queueClient = base.StorageAccount.CreateCloudQueueClient();
            subscribeQueue = queueClient.GetQueueReference(ConfigurationManager.AppSettings["QueueAzuremailsubscribequeue"]);
            subscribeQueue.CreateIfNotExists();            
        }
开发者ID:prashanthganathe,项目名称:PersonalProjects,代码行数:8,代码来源:QueueHelper.cs


示例15: AnalyzeSummonerMatchHistoryQueue

        public AnalyzeSummonerMatchHistoryQueue(CloudQueueClient queueClient)
        {
            Guard.NotNull(queueClient, nameof(queueClient));

            this._queueClient = queueClient;

            this._dequeuedMessages = new ConcurrentDictionary<int, CloudQueueMessage>();
        }
开发者ID:LeagueLogbook,项目名称:Logbook,代码行数:8,代码来源:AnalyzeSummonerMatchHistoryQueue.cs


示例16: UpdateSummonerQueue

        public UpdateSummonerQueue(CloudQueueClient queueClient)
        {
            Guard.NotNull(queueClient, nameof(queueClient));

            this._queueClient = queueClient;

            this._dequeuedMessages = new ConcurrentDictionary<int, CloudQueueMessage>();
        }
开发者ID:LeagueLogbook,项目名称:Logbook,代码行数:8,代码来源:UpdateSummonerQueue.cs


示例17: QueueHelper

        // Constructor - pass in a storage connection string.
        public QueueHelper(string connectionString)
        {
            Account = CloudStorageAccount.Parse(connectionString);

            QueueClient = Account.CreateCloudQueueClient();
            IRetryPolicy linearRetryPolicy = new LinearRetry(TimeSpan.Zero, 4);
            QueueClient.RetryPolicy = linearRetryPolicy;
        }
开发者ID:ramonyoung7,项目名称:Azure-Storage-Samples,代码行数:9,代码来源:QueueHelper.cs


示例18: Initialize

        public static void Initialize(string storageConnectionString, string ocrQueueName, string emailQueueName)
        {
            storageAccount = CloudStorageAccount.Parse(storageConnectionString);
            queueClient = storageAccount.CreateCloudQueueClient();

            ocrQueue = InitializeQueue(ocrQueueName);
            emailQueue = InitializeQueue(emailQueueName);
        }
开发者ID:melicamp,项目名称:azure-cloud-ocr,代码行数:8,代码来源:AzureQueues.cs


示例19: CloudQueue

 /// <summary>
 /// Initializes a new instance of the <see cref="CloudQueue"/> class.
 /// </summary>
 /// <param name="queueName">The queue name.</param>
 /// <param name="serviceClient">A client object that specifies the endpoint for the queue service.</param>
 internal CloudQueue(string queueName, CloudQueueClient serviceClient)
 {
     this.Uri = NavigationHelper.AppendPathToUri(serviceClient.BaseUri, queueName);
     this.ServiceClient = serviceClient;
     this.Name = queueName;
     this.Metadata = new Dictionary<string, string>();
     this.EncodeMessage = true;
 }
开发者ID:nberardi,项目名称:azure-sdk-for-net,代码行数:13,代码来源:CloudQueueBase.cs


示例20: CallQueueService

        public CallQueueService(string storageConnectionStringConfigName = "StorageConnectionString")
        {
            var connectionString = CloudConfigurationManager.GetSetting(storageConnectionStringConfigName);
            var storageAccount = CloudStorageAccount.Parse(connectionString);

            this.queueClient = storageAccount.CreateCloudQueueClient();
            this.queue = queueClient.GetQueueReference("calls");
            this.queue.CreateIfNotExists();
        }
开发者ID:NicolajLarsen,项目名称:PnP,代码行数:9,代码来源:CallQueueService.cs



注:本文中的Microsoft.WindowsAzure.Storage.Queue.CloudQueueClient类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Queue.CloudQueueMessage类代码示例发布时间:2022-05-26
下一篇:
C# Queue.CloudQueue类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap