VOOZH about

URL: https://www.nuget.org/packages/Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase/

⇱ NuGet Gallery | Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase 2.6.3




Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase 2.6.3

dotnet add package Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase --version 2.6.3
 
 
NuGet\Install-Package Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase -Version 2.6.3
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase" Version="2.6.3" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase" Version="2.6.3" />
 
Directory.Packages.props
<PackageReference Include="Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase --version 2.6.3
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase, 2.6.3"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase@2.6.3
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase&version=2.6.3
 
Install as a Cake Addin
#tool nuget:?package=Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase&version=2.6.3
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase

👁 NuGet

Demonstrates signal emission, async dispatch, and sink polling patterns.

dotnet add package mostlylucid.ephemeral.patterns.signalreactionshowcase

Quick Start

using Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase;

var result = await SignalReactionShowcase.RunAsync(itemCount: 100);

Console.WriteLine($"Dispatched: {result.DispatchedHits}");
Console.WriteLine($"Polled: {result.PolledHits}");
Console.WriteLine($"Total signals: {result.Signals.Count}");

All Options

SignalReactionShowcase.RunAsync(
 // Number of work items to process
 // Default: 8
 itemCount: 8,

 // Optional cancellation token
 ct: cancellationToken
)

API Reference

// Run the showcase demo
Task<Result> SignalReactionShowcase.RunAsync(
 int itemCount = 8,
 CancellationToken ct = default);

// Result record
public sealed record Result(
 int DispatchedHits, // Signals handled by dispatcher
 int PolledHits, // Signals found by polling
 IReadOnlyList<string> Signals); // All signal names

Key Concepts

1. Signal Emission

Work items raise signals synchronously (fast, non-blocking):

var signal = new SignalEvent($"stage.start:{item}", id, null, DateTimeOffset.UtcNow);
sink.Raise(signal);

2. Async Dispatch

SignalDispatcher processes signals in background:

dispatcher.Register("stage.done:*", async evt =>
{
 // Handle signal asynchronously
 await LogCompletionAsync(evt);
});

dispatcher.Dispatch(signal);

3. Sink Polling

Query signals by pattern after work completes:

var completed = sink.Sense(s => s.Signal.StartsWith("stage.done"));

How It Works

Work Item Processing:
┌─────────────────────────────────────────────────────────────┐
│ [start] ─> emit "stage.start:N" ─> [work] ─> emit "stage.done:N" │
└─────────────────────────────────────────────────────────────┘
 │ │
 ▼ ▼
 SignalSink SignalDispatcher
 (for polling) (async handlers)

Example: Custom Signal Handling

var sink = new SignalSink(maxCapacity: 200, maxAge: TimeSpan.FromSeconds(10));
var dispatched = 0;

await using var dispatcher = new SignalDispatcher(
 new EphemeralOptions { MaxTrackedOperations = 200, MaxConcurrency = 4 });

dispatcher.Register("stage.done:*", evt =>
{
 Interlocked.Increment(ref dispatched);
 Console.WriteLine($"Completed: {evt.Signal}");
 return Task.CompletedTask;
});

await using var coordinator = new EphemeralWorkCoordinator<int>(
 async (item, ct) =>
 {
 var start = new SignalEvent($"stage.start:{item}", item, null, DateTimeOffset.UtcNow);
 sink.Raise(start);
 dispatcher.Dispatch(start);

 await Task.Delay(10, ct); // Simulate work

 var done = new SignalEvent($"stage.done:{item}", item, null, DateTimeOffset.UtcNow);
 sink.Raise(done);
 dispatcher.Dispatch(done);
 },
 new EphemeralOptions { MaxConcurrency = 8 });

for (int i = 0; i < 50; i++)
 await coordinator.EnqueueAsync(i);

coordinator.Complete();
await coordinator.DrainAsync();
await dispatcher.FlushAsync();

// Poll results
var startSignals = sink.Sense(s => s.Signal.StartsWith("stage.start")).Count;
var doneSignals = sink.Sense(s => s.Signal.StartsWith("stage.done")).Count;

Console.WriteLine($"Started: {startSignals}, Done: {doneSignals}, Dispatched: {dispatched}");

Example: Comparing Dispatch vs Polling

var result = await SignalReactionShowcase.RunAsync(itemCount: 100);

// DispatchedHits: Real-time processing via SignalDispatcher
// PolledHits: Batch query via SignalSink.Sense()

// Both should equal itemCount when all work completes
Assert.Equal(result.DispatchedHits, result.PolledHits);
Assert.Equal(100, result.DispatchedHits);

Related Packages

Package Description
mostlylucid.ephemeral Core library
mostlylucid.ephemeral.patterns.signallogwatcher Signal log watcher
mostlylucid.ephemeral.patterns.telemetry Telemetry integration
mostlylucid.ephemeral.complete All in one DLL

License

Unlicense (public domain)

Product Versions Compatible and additional computed target framework versions.
.NET net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 is compatible.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Mostlylucid.Ephemeral.Patterns.SignalReactionShowcase:

Package Downloads
mostlylucid.ephemeral.complete

Meta-package that references all Mostlylucid.Ephemeral packages - bounded async execution with signals, atoms, and patterns. Install this single package to get everything.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.6.3 98 5/22/2026
2.6.2 100 5/22/2026
2.6.0 95 5/22/2026
2.5.1 101 5/22/2026
2.5.0 102 5/3/2026
2.4.0 109 4/17/2026
2.3.2 131 1/9/2026
2.3.1 125 1/9/2026
2.3.1-alpha0 117 1/9/2026
2.3.0 1,197 1/8/2026
2.3.0-alpha1 124 1/8/2026
2.1.0 117 1/8/2026
2.1.0-preview 117 1/8/2026
2.0.1 119 1/8/2026
2.0.0 159 1/8/2026
2.0.0-alpha1 116 1/8/2026
1.7.1 442 12/11/2025
1.6.8 454 12/9/2025
1.6.7 453 12/9/2025
1.6.6 454 12/9/2025
Loading failed