public HyperNodeActivityObserver(HyperNodeServiceActivityMonitor underlyingMonitor, IObservable <IHyperNodeActivityEventItem> activityEventStream, IScheduler scheduler, HyperNodeTaskInfo taskInfo) { _underlyingMonitor = underlyingMonitor; _activity = taskInfo.Activity; _scheduler = scheduler; _subscription = activityEventStream .Where( e => { var shouldTrack = false; try { // ...for activity items matching the specified criteria shouldTrack = underlyingMonitor.ShouldTrack(e); } catch (Exception ex) { // This is legal at this point because we already subscribed our cache and task trace monitors earlier _activity.TrackException( new ActivityMonitorException( $"Unable to subscribe activity monitor '{underlyingMonitor.Name}' because its {nameof(HyperNodeServiceActivityMonitor.ShouldTrack)}() method threw an exception.", ex ) ); } return(shouldTrack); } ).TakeUntil(taskInfo.TerminatingSequence) .ObserveOn(scheduler) .SubscribeSafe(this); }
public TaskCompletedEventArgs(ITaskActivityTracker activity, ITaskEventContext taskContext, IReadOnlyHyperNodeResponseInfo responseInfo) : base(activity, taskContext) { ResponseInfo = responseInfo; }
public TaskStartedEventArgs(ITaskActivityTracker activity, ITaskEventContext taskContext, Action cancelTaskAction) : base(activity, taskContext) { _cancelTaskAction = cancelTaskAction; }
public HyperNodeEventArgs(ITaskActivityTracker activity, ITaskEventContext taskContext) { Activity = activity; TaskContext = taskContext; }
public MessageReceivedEventArgs(ITaskActivityTracker activity, ITaskEventContext taskContext, Action <string> rejectMessageAction) : base(activity, taskContext) { _rejectMessageAction = rejectMessageAction; }