perf(eventbus): remove inline allocations and expose binding snapshots
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user