Exemplo n.º 1
0
 /// <summary>
 /// Register a state changed handler.
 /// </summary>
 public static IReaderBuilder <TMessage> StateChangedHandler <TMessage>(
     this IReaderBuilder <TMessage> builder,
     Func <ReaderStateChanged, CancellationToken, ValueTask> handler,
     CancellationToken cancellationToken = default)
 {
     builder.StateChangedHandler(new FuncStateChangedHandler <ReaderStateChanged>(handler, cancellationToken));
     return(builder);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Register a state changed handler.
 /// </summary>
 public static IReaderBuilder <TMessage> StateChangedHandler <TMessage>(
     this IReaderBuilder <TMessage> builder,
     Action <ReaderStateChanged, CancellationToken> handler,
     CancellationToken cancellationToken = default)
 {
     builder.StateChangedHandler(new ActionStateChangedHandler <ReaderStateChanged>(handler, cancellationToken));
     return(builder);
 }