perf(eventbus): remove inline allocations and expose binding snapshots
Publish NuGet packages / publish (push) Successful in 2m37s
Publish UPM package / publish (push) Successful in 2s

This commit is contained in:
2026-09-29 10:14:45 +08:00
parent c44a7e6dda
commit a92c9d2cea
7 changed files with 50 additions and 10 deletions
+8
View File
@@ -143,6 +143,14 @@ namespace ShrinkEventBus
return generated.AttachGenerated(Resolver, defaultBus ?? ShrinkBusKey.Game);
}
public static IReadOnlyList<(Type EventType, System.Reflection.MethodInfo Handler)> CaptureBindings(IShrinkEventBus bus)
{
if (bus is ShrinkEventBusInstance instance) return instance.CaptureBindings();
throw new NotSupportedException("This event bus does not expose binding diagnostics.");
}
public static IReadOnlyList<IShrinkEventBus> CaptureNamedBuses() => new List<IShrinkEventBus>(Buses.Values);
internal static IReadOnlyList<(ShrinkBusKey Key, ShrinkBusOptions Options, int Subscribers)> Snapshot()
{
var snapshot = new List<(ShrinkBusKey, ShrinkBusOptions, int)>(Buses.Count);