55namespace AsyncFiberWorks . Procedures
66{
77 /// <summary>
8- /// Keep only one value. It provides a task from setting the value
9- /// to the completion of processing, and a task until it is set.
8+ /// Use "await" to simply wait for the start of a task on a sequential handler list.
109 /// </summary>
1110 /// <typeparam name="T"></typeparam>
12- public class AsyncRegister < T > : IDisposable
11+ public class SequentialHandlerWaiter < T > : IDisposable
1312 {
1413 private readonly object _lockObj = new object ( ) ;
1514 private readonly IDisposable _subscription ;
@@ -22,23 +21,23 @@ public class AsyncRegister<T> : IDisposable
2221 private CancellationToken _cancellationToken ;
2322
2423 /// <summary>
25- /// Subscribe a handler list.
24+ /// Register a handler to the sequential handler list.
2625 /// </summary>
2726 /// <param name="handlerList"></param>
2827 /// <param name="cancellationToken"></param>
29- public AsyncRegister ( ISequentialHandlerListRegistry < T > handlerList , CancellationToken cancellationToken = default )
28+ public SequentialHandlerWaiter ( ISequentialHandlerListRegistry < T > handlerList , CancellationToken cancellationToken = default )
3029 {
3130 _cancellationToken = cancellationToken ;
32- _subscription = handlerList . Add ( ( arg ) => SetValueAndWaitClearing ( arg ) ) ;
31+ _subscription = handlerList . Add ( ( arg ) => ExecuteAsync ( arg ) ) ;
3332 }
3433
3534 /// <summary>
36- /// Set the value and wait for it to be cleared .
35+ /// Execute a handler .
3736 /// </summary>
3837 /// <param name="newValue"></param>
3938 /// <returns></returns>
4039 /// <exception cref="InvalidOperationException"></exception>
41- async Task < bool > SetValueAndWaitClearing ( T newValue )
40+ async Task < bool > ExecuteAsync ( T newValue )
4241 {
4342 lock ( _lockObj )
4443 {
@@ -81,12 +80,12 @@ async Task<bool> SetValueAndWaitClearing(T newValue)
8180 }
8281
8382 /// <summary>
84- /// Wait for the value to be set .
83+ /// Wait for handler execution .
8584 /// </summary>
8685 /// <returns></returns>
8786 /// <exception cref="ObjectDisposedException"></exception>
8887 /// <exception cref="OperationCanceledException"></exception>
89- public async Task < ProcessedFlagEventArgs < T > > WaitSetting ( )
88+ public async Task < ProcessedFlagEventArgs < T > > ExecutionStarted ( )
9089 {
9190 lock ( _lockObj )
9291 {
@@ -117,7 +116,7 @@ public async Task<ProcessedFlagEventArgs<T>> WaitSetting()
117116 }
118117
119118 /// <summary>
120- /// Unsubscribe .
119+ /// Unregister a handle from the sequential handler list .
121120 /// </summary>
122121 public void Dispose ( )
123122 {
0 commit comments