dev/fixtures/SamplePulseSubscription.cs

A small disposable helper type used as a RAII-style subscription token. It stores an Action to call on Dispose and invokes it once, then clears the reference.

namespace SuperuserCompatibilityLab.Engine.Modules;

internal sealed class SamplePulseSubscription : IDisposable
{
	private Action _release;
	internal SamplePulseSubscription( Action release ) => _release = release;
	public void Dispose()
	{
		var release = _release;
		_release = null;
		release?.Invoke();
	}
}