Example #1
0
 public static TaskHubClientSettings CreateTestClientSettings()
 {
     var settings = new TaskHubClientSettings();
     settings.MessageCompressionSettings = new CompressionSettings
     {
         Style = CompressionStyle.Threshold,
         ThresholdInBytes = 1024
     };
     return settings;
 }
        /// <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);
            }
        }
 /// <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)
 {
 }
Example #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);
            }
        }
Example #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)
 {
 }