Class CompositeTracker
Provides several trackers as one: the switch and every event go to each.
public sealed class CompositeTracker : ITracker
- Inheritance
-
CompositeTracker
- Implements
- Inherited Members
Remarks
A member's failure is logged and keeps the events from no other member; a cancellation is thrown.
Constructors
CompositeTracker(IReadOnlyList<ITracker>, bool)
Provides several trackers as one: the switch and every event go to each.
public CompositeTracker(IReadOnlyList<ITracker> trackers, bool isEnabled)
Parameters
trackersIReadOnlyList<ITracker>The trackers.
isEnabledboolWhether the composite sends events; the members keep their own switches until IsEnabled is set.
Remarks
A member's failure is logged and keeps the events from no other member; a cancellation is thrown.
Properties
IsEnabled
Gets or sets a value indicating whether the tracker sends events; off, it drops them.
public bool IsEnabled { get; set; }
Property Value
Remarks
A set goes to every member, and the composite keeps the value it is given, so whoever set it reads back what it set, whatever a member does with it.
Trackers
Gets the trackers.
public IReadOnlyList<ITracker> Trackers { get; }
Property Value
Methods
Track(TrackEvent, CancellationToken)
Sends an event.
public Task Track(TrackEvent trackEvent, CancellationToken cancellationToken)
Parameters
trackEventTrackEventThe event.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Exceptions
- OperationCanceledException
The token was canceled, or a member threw a cancellation.
Track(IEnumerable<TrackEvent>, CancellationToken)
Sends events.
public Task Track(IEnumerable<TrackEvent> trackEvents, CancellationToken cancellationToken)
Parameters
trackEventsIEnumerable<TrackEvent>The events.
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
- Task
A task that represents the asynchronous operation.
Remarks
Off, it sends nothing; on, it sends the events to every member at once.
Exceptions
- OperationCanceledException
The token was canceled, or a member threw a cancellation.