public void OnProcessError(RpcProcessErrorEventArgs e) { if (disposed) { return; } errors.Add(e.Errors); }
private void RaiseProcessOnError(RpcProcessErrorEventArgs args) { if (!wrappers.TryGetValue(args.Process.Id, out var list) || !schedulers.TryGetValue(args.Process.Id, out var scheduler)) { throw new InvalidOperationException( $"OnError for process {args.Process.Id} was called but there's no record of it in the process list."); } foreach (var wrapper in list) { scheduler.Schedule(s => wrapper.OnProcessError((RpcProcessErrorEventArgs)s), args, cts.Token); } }
private void RaiseOnProcessError(string id, string error) { if (cts.IsCancellationRequested) { return; } if (processes.TryGetValue(id, out var context) && context.Client != null) { taskManager .WithAsync(async ctx => { var data = new NotificationData(ctx.Client.GetRemoteTarget <IProcessNotifications>(), RpcProcessErrorEventArgs.Get(ctx.Process, error)); await data.notifications.ProcessOnError(data.ErrorArgs); return(0); }, context, TaskAffinity.Custom) .Start(context.Notifications); } }
public NotificationData(IProcessNotifications notifications, RpcProcessErrorEventArgs args) { this.notifications = notifications; this.args = args; }
public Task ProcessOnError(RpcProcessErrorEventArgs args) { manager.RaiseProcessOnError(args); return(Task.CompletedTask); }