Meatcorps.Engine.Signals 0.1.17-preview.19

This is a prerelease version of Meatcorps.Engine.Signals.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Meatcorps.Engine.Signals --version 0.1.17-preview.19
                    
NuGet\Install-Package Meatcorps.Engine.Signals -Version 0.1.17-preview.19
                    
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="Meatcorps.Engine.Signals" Version="0.1.17-preview.19" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meatcorps.Engine.Signals" Version="0.1.17-preview.19" />
                    
Directory.Packages.props
<PackageReference Include="Meatcorps.Engine.Signals" />
                    
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 Meatcorps.Engine.Signals --version 0.1.17-preview.19
                    
#r "nuget: Meatcorps.Engine.Signals, 0.1.17-preview.19"
                    
#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 Meatcorps.Engine.Signals@0.1.17-preview.19
                    
#: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=Meatcorps.Engine.Signals&version=0.1.17-preview.19&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Meatcorps.Engine.Signals&version=0.1.17-preview.19&prerelease
                    
Install as a Cake Tool

Meatcorps.Engine.Signals

Typed signal values that automatically broadcast changes to all other instances sharing the same group and topic. Works in-process out of the box, and can be extended with remote backends (e.g. MQTT) by registering a custom tracker.

Backends

Backend Package Description
In-memory Meatcorps.Engine.Signals (this package) Syncs within the same process. No external dependencies.
MQTT Meatcorps.Engine.MQTT Syncs across processes/machines over MQTT.

In-memory setup

Call SignalModule.Load() once at startup. This registers an InternalSignalValueEvent tracker for the built-in SignalDefault.Internal group:

SignalModule.Load();

Then create signal values using SignalDefault.Internal as the group:

var score = new SignalValue<int, SignalDefault>(SignalDefault.Internal, "game/score", initialValue: 0);

All SignalValue instances with the same group and topic will stay in sync within the process.

Custom group (for multiple trackers)

Define your own group enum when you need to separate concerns or use a different backend per group:

public enum MyGroup { Local, Remote }

Register a tracker for each group you use:

var tracker = new InternalSignalValueEvent<MyGroup>(MyGroup.Local);
GlobalObjectManager.ObjectManager.RegisterSet<ISignalValueEvent<MyGroup>>();
GlobalObjectManager.ObjectManager.Add<ISignalValueEvent<MyGroup>>(tracker);

Basic usage

// Read / write
score.Value = 100;         // broadcasts to all matching signal values
int current = score.Value;

// Subscribe to changes (local sets and incoming remote updates)
score.ValueChanged += value => Console.WriteLine($"Score: {value}");

// Subscribe only to values arriving from a remote tracker
score.IncomingValue += value => Console.WriteLine($"Incoming: {value}");

// Push the current value without changing it (useful for initial sync)
score.Push();

Custom tracker backend

You can implement your own backend (e.g. WebSocket, Redis, file) by extending BaseSignalValueEvent<TGroup>. The only requirement is implementing GetGroup():

public class MyCustomTracker : BaseSignalValueEvent<MyGroup>
{
    private readonly MyGroup _group;

    public MyCustomTracker(MyGroup group)
    {
        _group = group;
    }

    public override MyGroup GetGroup() => _group;

    // Optional: override OnDispose(bool disposing) to clean up custom resources
}

BaseSignalValueEvent<TGroup> handles registration, deduplication, Rx subject routing, and broadcasting to all matching signal values. Your implementation only needs to add transport-specific logic (e.g. publishing to a remote broker) by calling into GetSubject<TValueType>(topic) or SetValue<TValueType>(topic, value).

Register it the same way as the built-in tracker:

var tracker = new MyCustomTracker(MyGroup.Remote);
GlobalObjectManager.ObjectManager.RegisterSet<ISignalValueEvent<MyGroup>>();
GlobalObjectManager.ObjectManager.Add<ISignalValueEvent<MyGroup>>(tracker);

Disposal

SignalValue implements IDisposable. Always dispose when the owning object is destroyed to unregister from the tracker and stop receiving updates:

score.Dispose();

Notes

  • If no tracker is registered for the given group and no initialValue is provided, the constructor throws ArgumentNullException. This is a fail-fast guard — a tracker must exist before signals of that group can be created.
  • Value changes are skipped if the new value equals the current value (DistinctUntilChanged).
  • Signal identity is based on (Group, Topic) — two SignalValue instances with the same group and topic share state through the tracker.

License

MIT License See LICENSE for details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  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 Meatcorps.Engine.Signals:

Package Downloads
Meatcorps.Engine.MQTT

Meatcorps.Engine is a lightweight, code-first game framework built on top of Raylib. This is the Logging package

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.17-preview.20 0 3/5/2026
0.1.17-preview.19 36 2/25/2026
0.1.17-preview.18 38 2/25/2026
0.1.17-preview.17 41 2/24/2026
0.1.16 132 2/20/2026
0.1.15 136 2/14/2026
0.1.14 135 2/14/2026
0.1.13 134 2/14/2026
0.1.11 136 2/14/2026
0.1.10 129 2/14/2026
0.1.9 153 1/12/2026
0.1.8 142 1/11/2026
0.1.7 138 1/10/2026
0.1.6 144 1/10/2026
0.1.5 139 1/10/2026
0.1.4 154 1/4/2026
0.1.0 157 1/4/2026