< Summary

Information
Class: CounterpointCollective.Dataflow.Notifying.NotifyingSourceBlockAsyncHooks<T>
Assembly: Dataflow.Composable
File(s): /builds/counterpointcollective/composabledataflowblocks/Source/Dataflow.Composable/DataFlow/Notifying/NotifyingSourceBlockHooks.cs
Line coverage
100%
Covered lines: 3
Uncovered lines: 0
Coverable lines: 3
Total lines: 44
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_SourceBlock()100%11100%
get_OnDeliveringMessagesAsync()100%11100%
get_OnReservationReleasedAsync()100%11100%

File(s)

/builds/counterpointcollective/composabledataflowblocks/Source/Dataflow.Composable/DataFlow/Notifying/NotifyingSourceBlockHooks.cs

#LineLine coverage
 1using CounterpointCollective.Collections;
 2using System.Threading.Tasks.Dataflow;
 3
 4namespace CounterpointCollective.Dataflow.Notifying
 5{
 6    public record NotifyingSourceBlockHooks {
 7
 8        /// <summary>
 9        /// Callback to configure the dispatching of notification events.
 10        /// Defaults to UseAsynchronousDispatch.
 11        /// </summary>
 12        public Action<ICoalescingQueue> ConfigureDispatching { get; set; } = q => q.UseAsynchronousDispatch();
 13    }
 14
 15    public record NotifyingSourceBlockHooks<T>(ISourceBlock<T> SourceBlock): NotifyingSourceBlockHooks
 16    {
 17        /// <summary>
 18        /// This Action will be executed when a messages are sent from the source block.
 19        /// </summary>
 20        public Action<int>? OnDeliveringMessages { get; set; }
 21
 22        /// <summary>
 23        /// This Action will be executed when a linked target released its reservation.
 24        /// </summary>
 25        public Action? OnReservationReleased { get; set; }
 26    }
 27
 228    public record NotifyingSourceBlockAsyncHooks<T>(ISourceBlock<T> SourceBlock) : NotifyingSourceBlockHooks
 29    {
 30        /// <summary>
 31        /// This Action will be executed when a messages are sent from the source block.
 32        /// </summary>
 333        public Func<int, ValueTask>? OnDeliveringMessagesAsync { get; set; }
 34
 35        /// <summary>
 36        /// This Action will be executed when a linked target released its reservation.
 37        /// </summary>
 138        public Func<ValueTask>? OnReservationReleasedAsync { get; set; }
 39    }
 40
 41    public delegate void ConfigureHooks<T>(NotifyingSourceBlockHooks<T> hooks);
 42    public delegate void ConfigureAsyncHooks<T>(NotifyingSourceBlockAsyncHooks<T> hooks);
 43
 44}