protected TaskRunnerProxy(int id, ITaskRunnerRegistry registry, ILogger logger)
     : base(id, logger)
 {
     _registry = registry ?? throw new ArgumentNullException(nameof(registry));
     _registry.StateUpdated    += Registry_StateUpdate;
     _registry.ProgressUpdated += Registry_ProgressUpdated;
 }
        public static async ValueTask <TaskRunnerProxy> Create(int id, ITaskRunnerRegistry registry, ILogger logger)
        {
            var trp      = new TaskRunnerProxy(id, registry, logger);
            var state    = registry.GetState(id);
            var progress = registry.GetProgress(id);

            trp.StateSubject.Init(await state.ConfigureAwait(false));
            trp.ProgressSubject.Init(await progress.ConfigureAwait(false));
            return(trp);
        }