コード例 #1
0
ファイル: TestHelpers.cs プロジェクト: Frank-Tao/durabletask
 public static TaskHubClientSettings CreateTestClientSettings()
 {
     var settings = new TaskHubClientSettings();
     settings.MessageCompressionSettings = new CompressionSettings
     {
         Style = CompressionStyle.Threshold,
         ThresholdInBytes = 1024
     };
     return settings;
 }
コード例 #2
0
        /// <summary>
        ///     Create a new TaskHubClient with given name, Service Bus and Azure Storage connection strings  with specified
        ///     settings.
        /// </summary>
        /// <param name="hubName">Name of the Task Hub</param>
        /// <param name="connectionString">Service Bus connection string</param>
        /// <param name="tableStoreConnectionString">Azure Storage connection string</param>
        /// <param name="settings">Client settings</param>
        public TaskHubClient(string hubName, string connectionString, string tableStoreConnectionString,
                             TaskHubClientSettings settings)
        {
            this.hubName           = hubName;
            this.connectionString  = connectionString;
            messagingFactory       = Utils.CreateMessagingFactory(connectionString);
            workerEntityName       = string.Format(FrameworkConstants.WorkerEndpointFormat, this.hubName);
            orchestratorEntityName = string.Format(FrameworkConstants.OrchestratorEndpointFormat, this.hubName);
            defaultConverter       = new JsonDataConverter();
            this.settings          = settings;

            this.tableStoreConnectionString = tableStoreConnectionString;
            if (!string.IsNullOrEmpty(this.tableStoreConnectionString))
            {
                tableClient = new TableClient(this.hubName, this.tableStoreConnectionString);
            }
        }
コード例 #3
0
 /// <summary>
 ///     Create a new TaskHubClient with given name and service bus connection string with specified settings.
 /// </summary>
 /// <param name="hubName">Name of the Task Hub</param>
 /// <param name="connectionString">Service Bus connection string</param>
 /// <param name="settings">Client settings</param>
 public TaskHubClient(string hubName, string connectionString, TaskHubClientSettings settings)
     : this(hubName, connectionString, null, settings)
 {
 }
コード例 #4
0
        /// <summary>
        ///     Create a new TaskHubClient with given name, Service Bus and Azure Storage connection strings  with specified
        ///     settings.
        /// </summary>
        /// <param name="hubName">Name of the Task Hub</param>
        /// <param name="connectionString">Service Bus connection string</param>
        /// <param name="tableStoreConnectionString">Azure Storage connection string</param>
        /// <param name="settings">Client settings</param>
        public TaskHubClient(string hubName, string connectionString, string tableStoreConnectionString,
            TaskHubClientSettings settings)
        {
            this.hubName = hubName;
            this.connectionString = connectionString;
            messagingFactory = Utils.CreateMessagingFactory(connectionString);
            workerEntityName = string.Format(FrameworkConstants.WorkerEndpointFormat, this.hubName);
            orchestratorEntityName = string.Format(FrameworkConstants.OrchestratorEndpointFormat, this.hubName);
            defaultConverter = new JsonDataConverter();
            this.settings = settings;

            this.tableStoreConnectionString = tableStoreConnectionString;
            if (!string.IsNullOrEmpty(this.tableStoreConnectionString))
            {
                tableClient = new TableClient(this.hubName, this.tableStoreConnectionString);
            }
        }
コード例 #5
0
 /// <summary>
 ///     Create a new TaskHubClient with given name and service bus connection string with specified settings.
 /// </summary>
 /// <param name="hubName">Name of the Task Hub</param>
 /// <param name="connectionString">Service Bus connection string</param>
 /// <param name="settings">Client settings</param>
 public TaskHubClient(string hubName, string connectionString, TaskHubClientSettings settings)
     : this(hubName, connectionString, null, settings)
 {
 }