public static async Task <OrchestrationSessionPartitionHandler> GetOrchestrationSessionManagerAsync(ConnectionMultiplexer redisConnection, string taskHub, string partition = "singleton") { OrchestrationSessionPartitionHandler sessionManager = new OrchestrationSessionPartitionHandler(redisConnection, taskHub, partition); await sessionManager.InitializeAsync(); return(sessionManager); }
/// <inheritdoc /> public async Task StartAsync() { await this.startLock.WaitAsync(); if (this.workerGuid == null) { this.redisConnection = await ConnectionMultiplexer.ConnectAsync(this.settings.RedisConnectionString); this.workerRecycler = new WorkerRecycler(this.settings.TaskHubName, this.redisConnection); await this.workerRecycler.CleanupWorkersAsync(); this.workerGuid = Guid.NewGuid().ToString(); RegisterWorker(); this.partitionOrchestrationManager = await OrchestrationSessionPartitionHandler.GetOrchestrationSessionManagerAsync(this.redisConnection, this.settings.TaskHubName); this.activityTaskManager = new ActivityTaskHandler(taskHub: this.settings.TaskHubName, workerId: this.workerGuid, connection: this.redisConnection); this.logger = new RedisLogger(this.redisConnection, this.settings.TaskHubName); } this.startLock.Release(); }