com.wallstop-studios.dxmessaging 3.1.0 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +326 -0
- package/Editor/Analyzers/BaseCallLogMessageParser.cs.meta +3 -3
- package/Editor/Analyzers/BaseCallReportAggregator.cs.meta +3 -3
- package/Editor/Analyzers/DxMessagingConsoleHarvester.cs +8 -8
- package/Editor/Analyzers/DxMessagingConsoleHarvester.cs.meta +3 -3
- package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs +171 -13
- package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs.meta +3 -3
- package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs +391 -96
- package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs.meta +3 -3
- package/Editor/CustomEditors/MessageAwareComponentInspectorView.cs +279 -0
- package/Editor/CustomEditors/MessageAwareComponentInspectorView.cs.meta +11 -0
- package/Editor/DxMessagingEditorPalette.cs +66 -0
- package/Editor/DxMessagingEditorPalette.cs.meta +11 -0
- package/Editor/DxMessagingEditorTheme.cs +200 -0
- package/Editor/DxMessagingEditorTheme.cs.meta +11 -0
- package/Editor/DxMessagingMenu.cs.meta +3 -3
- package/Editor/DxMessagingSceneBuildProcessor.cs.meta +3 -3
- package/Editor/Icons/dxmessaging-icon-256.png +0 -0
- package/Editor/Icons/dxmessaging-icon-256.png.meta +156 -0
- package/Editor/Icons/dxmessaging-icon-32.png +0 -0
- package/Editor/Icons/dxmessaging-icon-32.png.meta +156 -0
- package/Editor/Icons/dxmessaging-icon-48.png +0 -0
- package/Editor/Icons/dxmessaging-icon-48.png.meta +156 -0
- package/Editor/Icons.meta +8 -0
- package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs +2 -3
- package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs.meta +3 -3
- package/Editor/Settings/DxMessagingSettingsProvider.cs +368 -33
- package/Editor/SetupCscRsp.cs +232 -163
- package/Editor/Testing/MessagingComponentEditorHarness.cs +11 -4
- package/Editor/Theme/DxMessagingTheme.uss +255 -0
- package/Editor/Theme/DxMessagingTheme.uss.meta +11 -0
- package/Editor/Theme/DxTokens.uss +90 -0
- package/Editor/Theme/DxTokens.uss.meta +11 -0
- package/Editor/Theme.meta +8 -0
- package/Editor/Windows/DxMessagingFlowGraphWindow.cs +5513 -0
- package/Editor/Windows/DxMessagingFlowGraphWindow.cs.meta +11 -0
- package/Editor/Windows/DxMessagingMessageMonitorWindow.cs +2288 -0
- package/Editor/Windows/DxMessagingMessageMonitorWindow.cs.meta +11 -0
- package/Editor/Windows.meta +8 -0
- package/README.md +84 -35
- package/Runtime/Analyzers.meta +8 -0
- package/Runtime/AssemblyInfo.cs +1 -0
- package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs.meta +3 -3
- package/Runtime/Core/Diagnostics/MessageEmissionData.cs +29 -1
- package/Runtime/Core/DxMessagingStaticState.cs.meta +3 -3
- package/Runtime/Core/Extensions/MessageBusExtensions.cs.meta +3 -3
- package/Runtime/Core/Extensions/MessageExtensions.cs +4 -5
- package/Runtime/Core/Extensions/MessageExtensions.cs.meta +3 -3
- package/Runtime/Core/Helper/MessageCache.cs +56 -23
- package/Runtime/Core/IMessage.cs.meta +3 -3
- package/Runtime/Core/InstanceId.cs.meta +3 -3
- package/Runtime/Core/Internal/FlatDispatch.cs +32 -0
- package/Runtime/Core/Internal/TypedSlots.cs +45 -7
- package/Runtime/Core/MessageBus/DiagnosticsTarget.cs.meta +3 -3
- package/Runtime/Core/MessageBus/GlobalMessageBusProvider.cs.meta +3 -3
- package/Runtime/Core/MessageBus/IMessageBus.cs +63 -28
- package/Runtime/Core/MessageBus/IMessageBus.cs.meta +3 -3
- package/Runtime/Core/MessageBus/IMessageBusProvider.cs.meta +3 -3
- package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs.meta +3 -3
- package/Runtime/Core/MessageBus/MessageBus.cs +1135 -626
- package/Runtime/Core/MessageBus/MessageBus.cs.meta +3 -3
- package/Runtime/Core/MessageBus/MessageBusRebindMode.cs.meta +3 -3
- package/Runtime/Core/MessageBus/MessageBusRegistration.cs +207 -0
- package/Runtime/Core/MessageBus/MessageBusRegistration.cs.meta +11 -0
- package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs.meta +3 -3
- package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +3 -3
- package/Runtime/Core/MessageBus/RegistrationLog.cs +25 -12
- package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +3 -3
- package/Runtime/Core/MessageHandler.cs +1886 -1082
- package/Runtime/Core/MessageHandler.cs.meta +3 -3
- package/Runtime/Core/MessageRegistrationHandle.cs +19 -5
- package/Runtime/Core/MessageRegistrationHandle.cs.meta +3 -3
- package/Runtime/Core/MessageRegistrationToken.cs +1932 -895
- package/Runtime/Core/MessageRegistrationToken.cs.meta +3 -3
- package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +3 -3
- package/Runtime/Core/Messages/ITargetedMessage.cs.meta +3 -3
- package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +3 -3
- package/Runtime/Core/Messages/SourcedStringMessage.cs.meta +3 -3
- package/Runtime/Core/MessagingDebug.cs.meta +3 -3
- package/Runtime/Unity/CurrentGlobalMessageBusProvider.cs.meta +3 -3
- package/Runtime/Unity/DxMessagingRuntimeInitializer.cs.meta +3 -3
- package/Runtime/Unity/InitialGlobalMessageBusProvider.cs.meta +3 -3
- package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs.meta +3 -3
- package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs.meta +3 -3
- package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs.meta +3 -3
- package/Runtime/Unity/MessageAwareComponent.cs.meta +3 -3
- package/Runtime/Unity/MessageBusProviderHandle.cs.meta +3 -3
- package/Runtime/Unity/MessagingComponent.cs.meta +3 -3
- package/Runtime/Unity/MessagingComponentInstaller.cs.meta +3 -3
- package/Runtime/Unity/ScriptableMessageBusProvider.cs.meta +3 -3
- package/Samples~/DI/Reflex/SampleInstaller.cs.meta +3 -3
- package/Samples~/DI/VContainer/SampleLifetimeScope.cs.meta +3 -3
- package/Samples~/DI/Zenject/SampleInstaller.cs.meta +3 -3
- package/Samples~/Diagnostics Tooling Exerciser/DiagnosticsToolingExerciser.cs +173 -0
- package/Samples~/Diagnostics Tooling Exerciser/DiagnosticsToolingExerciser.cs.meta +11 -0
- package/Samples~/Diagnostics Tooling Exerciser/DiagnosticsToolingExerciser.unity +424 -0
- package/Samples~/Diagnostics Tooling Exerciser/DiagnosticsToolingExerciser.unity.meta +7 -0
- package/Samples~/Diagnostics Tooling Exerciser/DiagnosticsToolingReceiver.cs +185 -0
- package/Samples~/Diagnostics Tooling Exerciser/DiagnosticsToolingReceiver.cs.meta +11 -0
- package/Samples~/Diagnostics Tooling Exerciser/Messages.cs +46 -0
- package/Samples~/Diagnostics Tooling Exerciser/Messages.cs.meta +11 -0
- package/Samples~/Diagnostics Tooling Exerciser/README.md +53 -0
- package/Samples~/Diagnostics Tooling Exerciser/README.md.meta +7 -0
- package/Samples~/Diagnostics Tooling Exerciser/WallstopStudios.DxMessaging.DiagnosticsToolingExerciser.Sample.asmdef +13 -0
- package/Samples~/Diagnostics Tooling Exerciser/WallstopStudios.DxMessaging.DiagnosticsToolingExerciser.Sample.asmdef.meta +7 -0
- package/Samples~/Diagnostics Tooling Exerciser.meta +8 -0
- package/Samples~/Mini Combat/Boot.cs.meta +3 -3
- package/Samples~/Mini Combat/Enemy.cs.meta +3 -3
- package/Samples~/Mini Combat/Messages.cs.meta +3 -3
- package/Samples~/Mini Combat/Player.cs.meta +3 -3
- package/Samples~/Mini Combat/README.md +1 -1
- package/Samples~/Mini Combat/UIOverlay.cs.meta +3 -3
- package/Samples~/Mini Combat/Walkthrough.md +3 -3
- package/Samples~/UI Buttons + Inspector/DiagnosticsEnabler.cs.meta +3 -3
- package/Samples~/UI Buttons + Inspector/Messages.cs.meta +3 -3
- package/Samples~/UI Buttons + Inspector/MessagingObserver.cs.meta +3 -3
- package/Samples~/UI Buttons + Inspector/UIButtonEmitter.cs.meta +3 -3
- package/SourceGenerators/Directory.Build.props +5 -5
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs.meta +3 -3
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj +12 -11
- package/docs/images/DxMessaging-banner.svg +79 -0
- package/docs/images/DxMessaging-banner.svg.meta +53 -0
- package/docs/images.meta +8 -0
- package/docs.meta +8 -0
- package/package.json +17 -5
- /package/{Editor → Runtime}/Analyzers/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- /package/{Editor → Runtime}/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +0 -0
- /package/{Editor → Runtime}/Analyzers/Microsoft.CodeAnalysis.dll +0 -0
- /package/{Editor → Runtime}/Analyzers/Microsoft.CodeAnalysis.dll.meta +0 -0
- /package/{Editor → Runtime}/Analyzers/System.Collections.Immutable.dll +0 -0
- /package/{Editor → Runtime}/Analyzers/System.Collections.Immutable.dll.meta +0 -0
- /package/{Editor → Runtime}/Analyzers/System.Reflection.Metadata.dll +0 -0
- /package/{Editor → Runtime}/Analyzers/System.Reflection.Metadata.dll.meta +0 -0
- /package/{Editor → Runtime}/Analyzers/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- /package/{Editor → Runtime}/Analyzers/System.Runtime.CompilerServices.Unsafe.dll.meta +0 -0
- /package/{Editor → Runtime}/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll +0 -0
- /package/{Editor → Runtime}/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll.meta +0 -0
- /package/{Editor → Runtime}/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll +0 -0
- /package/{Editor → Runtime}/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +0 -0
|
@@ -28,13 +28,9 @@ namespace DxMessaging.Core.Internal
|
|
|
28
28
|
/// surface picks up no new members from the interface retrofit.
|
|
29
29
|
/// </para>
|
|
30
30
|
/// <para>
|
|
31
|
-
/// Deliberately a thin
|
|
32
|
-
///
|
|
33
|
-
///
|
|
34
|
-
/// (<see cref="IsEmpty"/>, <see cref="Reset"/>) require. The
|
|
35
|
-
/// <c>entries</c> dictionary and <c>cache</c> list are NOT exposed
|
|
36
|
-
/// because their generic shape is the very thing this interface erases;
|
|
37
|
-
/// dispatchers that need the typed cache down-cast at the call site.
|
|
31
|
+
/// Deliberately a thin erased lifecycle surface for staged dispatch and eviction.
|
|
32
|
+
/// Generic keys, values, snapshot lists, and representation diagnostics are not
|
|
33
|
+
/// exposed; dispatchers that need typed entries down-cast at the call site.
|
|
38
34
|
/// </para>
|
|
39
35
|
/// </remarks>
|
|
40
36
|
internal interface IHandlerActionCache
|
|
@@ -83,6 +79,48 @@ namespace DxMessaging.Core.Internal
|
|
|
83
79
|
/// invalidation. Idempotent.
|
|
84
80
|
/// </summary>
|
|
85
81
|
void Reset();
|
|
82
|
+
|
|
83
|
+
/// <summary>
|
|
84
|
+
/// Non-generic membership probe over the cache's entries map. The
|
|
85
|
+
/// per-handle teardown object (which carries no delegate-shape type
|
|
86
|
+
/// argument) uses this instead of a typed
|
|
87
|
+
/// <c>entries.ContainsKey</c> so it can decide whether the
|
|
88
|
+
/// over-deregistration silent-no-op guard fires without down-casting
|
|
89
|
+
/// to the concrete <c>HandlerActionCache<TDelegate></c>.
|
|
90
|
+
/// </summary>
|
|
91
|
+
/// <param name="originalHandler">
|
|
92
|
+
/// The dedup/identity key (boxed delegate) the teardown captured at
|
|
93
|
+
/// registration time; cast back to the cache's delegate shape by the
|
|
94
|
+
/// implementation.
|
|
95
|
+
/// </param>
|
|
96
|
+
/// <returns>True iff an entry exists for the handler.</returns>
|
|
97
|
+
bool ContainsEntry(object originalHandler);
|
|
98
|
+
|
|
99
|
+
/// <summary>
|
|
100
|
+
/// Bumps <see cref="Version"/> by one. Mirrors the explicit
|
|
101
|
+
/// <c>version++</c> the legacy deregistration closure performed at the
|
|
102
|
+
/// top of its body (before the bus deregister call) so any in-flight
|
|
103
|
+
/// dispatch snapshot detects invalidation at the same point.
|
|
104
|
+
/// </summary>
|
|
105
|
+
void BumpVersion();
|
|
106
|
+
|
|
107
|
+
/// <summary>
|
|
108
|
+
/// Non-generic decrement-or-remove for the captured handler entry.
|
|
109
|
+
/// Mirrors the EXACT refcount logic the legacy deregistration closure
|
|
110
|
+
/// used: if the entry's refcount is at or below one, removes it from
|
|
111
|
+
/// both the entries map and the insertion-order list and bumps
|
|
112
|
+
/// <see cref="Version"/> a second time (reporting
|
|
113
|
+
/// <paramref name="wasLastForEntry"/> = true so the caller can
|
|
114
|
+
/// decrement the owning slot's live count); otherwise decrements the
|
|
115
|
+
/// refcount in place, preserving the first registration's handler /
|
|
116
|
+
/// flat invoker.
|
|
117
|
+
/// </summary>
|
|
118
|
+
/// <param name="originalHandler">The dedup/identity key (boxed delegate).</param>
|
|
119
|
+
/// <param name="wasLastForEntry">
|
|
120
|
+
/// True iff this call removed the entry (the refcount reached zero).
|
|
121
|
+
/// </param>
|
|
122
|
+
/// <returns>True iff an entry existed for the handler.</returns>
|
|
123
|
+
bool DeregisterEntry(object originalHandler, out bool wasLastForEntry);
|
|
86
124
|
}
|
|
87
125
|
|
|
88
126
|
/// <summary>
|
|
@@ -297,8 +297,11 @@ namespace DxMessaging.Core.MessageBus
|
|
|
297
297
|
/// <typeparam name="T">Specific type of UntargetedMessages to register for.</typeparam>
|
|
298
298
|
/// <param name="messageHandler">MessageHandler to register to accept UntargetedMessages of the specified type.</param>
|
|
299
299
|
/// <param name="priority">Priority at which to run; lower runs earlier.</param>
|
|
300
|
-
/// <returns>
|
|
301
|
-
|
|
300
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop receiving messages.</returns>
|
|
301
|
+
MessageBusRegistration RegisterUntargeted<T>(
|
|
302
|
+
MessageHandler messageHandler,
|
|
303
|
+
int priority = 0
|
|
304
|
+
)
|
|
302
305
|
where T : IUntargetedMessage;
|
|
303
306
|
|
|
304
307
|
/// <summary>
|
|
@@ -308,7 +311,7 @@ namespace DxMessaging.Core.MessageBus
|
|
|
308
311
|
/// <param name="target">Target of messages to listen for.</param>
|
|
309
312
|
/// <param name="messageHandler">MessageHandler to register the TargetedMessages of the specified type.</param>
|
|
310
313
|
/// <param name="priority">Priority at which to run; lower runs earlier.</param>
|
|
311
|
-
/// <returns>
|
|
314
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop receiving the messages.</returns>
|
|
312
315
|
/// <remarks>
|
|
313
316
|
/// To preserve frozen dispatch snapshots during in-flight emissions, the per-MessageHandler
|
|
314
317
|
/// typed-cache for <c>(target, priority)</c> is NOT removed when the last registration at
|
|
@@ -319,7 +322,7 @@ namespace DxMessaging.Core.MessageBus
|
|
|
319
322
|
/// at every spawned GameObject) should prefer <see cref="RegisterTargetedWithoutTargeting{T}"/>
|
|
320
323
|
/// or recycle MessageHandlers to avoid unbounded inner-dictionary growth.
|
|
321
324
|
/// </remarks>
|
|
322
|
-
|
|
325
|
+
MessageBusRegistration RegisterTargeted<T>(
|
|
323
326
|
InstanceId target,
|
|
324
327
|
MessageHandler messageHandler,
|
|
325
328
|
int priority = 0
|
|
@@ -333,8 +336,11 @@ namespace DxMessaging.Core.MessageBus
|
|
|
333
336
|
/// <typeparam name="T">Specific type of TargetedMessages to register for.</typeparam>
|
|
334
337
|
/// <param name="messageHandler">MessageHandler to register to accept all TargetedMessages of the specified type.</param>
|
|
335
338
|
/// <param name="priority">Priority at which to run; lower runs earlier.</param>
|
|
336
|
-
/// <returns>
|
|
337
|
-
|
|
339
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop receiving messages.</returns>
|
|
340
|
+
MessageBusRegistration RegisterTargetedWithoutTargeting<T>(
|
|
341
|
+
MessageHandler messageHandler,
|
|
342
|
+
int priority = 0
|
|
343
|
+
)
|
|
338
344
|
where T : ITargetedMessage;
|
|
339
345
|
|
|
340
346
|
/// <summary>
|
|
@@ -344,7 +350,7 @@ namespace DxMessaging.Core.MessageBus
|
|
|
344
350
|
/// <param name="source">InstanceId of the source for BroadcastMessages to listen to.</param>
|
|
345
351
|
/// <param name="messageHandler">MessageHandler to register to accept BroadcastMessages.</param>
|
|
346
352
|
/// <param name="priority"></param>
|
|
347
|
-
/// <returns>
|
|
353
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop receiving messages.</returns>
|
|
348
354
|
/// <remarks>
|
|
349
355
|
/// To preserve frozen dispatch snapshots during in-flight emissions, the per-MessageHandler
|
|
350
356
|
/// typed-cache for <c>(source, priority)</c> is NOT removed when the last registration at
|
|
@@ -355,7 +361,7 @@ namespace DxMessaging.Core.MessageBus
|
|
|
355
361
|
/// every spawned GameObject) should prefer <see cref="RegisterSourcedBroadcastWithoutSource{T}"/>
|
|
356
362
|
/// or recycle MessageHandlers to avoid unbounded inner-dictionary growth.
|
|
357
363
|
/// </remarks>
|
|
358
|
-
|
|
364
|
+
MessageBusRegistration RegisterSourcedBroadcast<T>(
|
|
359
365
|
InstanceId source,
|
|
360
366
|
MessageHandler messageHandler,
|
|
361
367
|
int priority = 0
|
|
@@ -369,8 +375,8 @@ namespace DxMessaging.Core.MessageBus
|
|
|
369
375
|
/// <typeparam name="T">Type of the BroadcastMessage to register.</typeparam>
|
|
370
376
|
/// <param name="messageHandler">MessageHandler to register to accept BroadcastMessages.</param>
|
|
371
377
|
/// <param name="priority"></param>
|
|
372
|
-
/// <returns>
|
|
373
|
-
|
|
378
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop receiving messages.</returns>
|
|
379
|
+
MessageBusRegistration RegisterSourcedBroadcastWithoutSource<T>(
|
|
374
380
|
MessageHandler messageHandler,
|
|
375
381
|
int priority = 0
|
|
376
382
|
)
|
|
@@ -381,8 +387,8 @@ namespace DxMessaging.Core.MessageBus
|
|
|
381
387
|
/// It doesn't matter if the message is Targeted or Untargeted, this MessageHandler will be invoked for it.
|
|
382
388
|
/// </summary>
|
|
383
389
|
/// <param name="messageHandler">MessageHandler to register to accept all messages.</param>
|
|
384
|
-
/// <returns>
|
|
385
|
-
|
|
390
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop receiving messages.</returns>
|
|
391
|
+
MessageBusRegistration RegisterGlobalAcceptAll(MessageHandler messageHandler);
|
|
386
392
|
|
|
387
393
|
/// <summary>
|
|
388
394
|
/// Registers the specified MessageHandler and transformer function as an interceptor for Messages of type T.
|
|
@@ -407,8 +413,8 @@ namespace DxMessaging.Core.MessageBus
|
|
|
407
413
|
/// Calling the returned deregistration action removes the interceptor from dispatch, but
|
|
408
414
|
/// the delegate reference may remain until the final deregistration of that interceptor.
|
|
409
415
|
/// </remarks>
|
|
410
|
-
/// <returns>
|
|
411
|
-
|
|
416
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop intercepting messages.</returns>
|
|
417
|
+
MessageBusRegistration RegisterUntargetedInterceptor<T>(
|
|
412
418
|
UntargetedInterceptor<T> interceptor,
|
|
413
419
|
int priority = 0
|
|
414
420
|
)
|
|
@@ -437,8 +443,11 @@ namespace DxMessaging.Core.MessageBus
|
|
|
437
443
|
/// Calling the returned deregistration action removes the interceptor from dispatch, but
|
|
438
444
|
/// the delegate reference may remain until the final deregistration of that interceptor.
|
|
439
445
|
/// </remarks>
|
|
440
|
-
/// <returns>
|
|
441
|
-
|
|
446
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop intercepting messages.</returns>
|
|
447
|
+
MessageBusRegistration RegisterTargetedInterceptor<T>(
|
|
448
|
+
TargetedInterceptor<T> interceptor,
|
|
449
|
+
int priority = 0
|
|
450
|
+
)
|
|
442
451
|
where T : ITargetedMessage;
|
|
443
452
|
|
|
444
453
|
/// <summary>
|
|
@@ -464,8 +473,8 @@ namespace DxMessaging.Core.MessageBus
|
|
|
464
473
|
/// Calling the returned deregistration action removes the interceptor from dispatch, but
|
|
465
474
|
/// the delegate reference may remain until the final deregistration of that interceptor.
|
|
466
475
|
/// </remarks>
|
|
467
|
-
/// <returns>
|
|
468
|
-
|
|
476
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop intercepting messages.</returns>
|
|
477
|
+
MessageBusRegistration RegisterBroadcastInterceptor<T>(
|
|
469
478
|
BroadcastInterceptor<T> interceptor,
|
|
470
479
|
int priority = 0
|
|
471
480
|
)
|
|
@@ -478,8 +487,11 @@ namespace DxMessaging.Core.MessageBus
|
|
|
478
487
|
/// <typeparam name="T">Type of UntargetedMessage to post-process.</typeparam>
|
|
479
488
|
/// <param name="messageHandler">MessageHandler to post-process messages for.</param>
|
|
480
489
|
/// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
|
|
481
|
-
/// <returns>
|
|
482
|
-
|
|
490
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop post-processing messages.</returns>
|
|
491
|
+
MessageBusRegistration RegisterUntargetedPostProcessor<T>(
|
|
492
|
+
MessageHandler messageHandler,
|
|
493
|
+
int priority = 0
|
|
494
|
+
)
|
|
483
495
|
where T : IUntargetedMessage;
|
|
484
496
|
|
|
485
497
|
/// <summary>
|
|
@@ -490,8 +502,8 @@ namespace DxMessaging.Core.MessageBus
|
|
|
490
502
|
/// <param name="target">Target of messages to listen for.</param>
|
|
491
503
|
/// <param name="messageHandler">MessageHandler to post-process messages for.</param>
|
|
492
504
|
/// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
|
|
493
|
-
/// <returns>
|
|
494
|
-
|
|
505
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop post-processing messages.</returns>
|
|
506
|
+
MessageBusRegistration RegisterTargetedPostProcessor<T>(
|
|
495
507
|
InstanceId target,
|
|
496
508
|
MessageHandler messageHandler,
|
|
497
509
|
int priority = 0
|
|
@@ -505,8 +517,8 @@ namespace DxMessaging.Core.MessageBus
|
|
|
505
517
|
/// <typeparam name="T">Type of TargetedMessage to post-process.</typeparam>
|
|
506
518
|
/// <param name="messageHandler">MessageHandler to post-process messages for.</param>
|
|
507
519
|
/// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
|
|
508
|
-
/// <returns>
|
|
509
|
-
|
|
520
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop post-processing messages.</returns>
|
|
521
|
+
MessageBusRegistration RegisterTargetedWithoutTargetingPostProcessor<T>(
|
|
510
522
|
MessageHandler messageHandler,
|
|
511
523
|
int priority = 0
|
|
512
524
|
)
|
|
@@ -520,8 +532,8 @@ namespace DxMessaging.Core.MessageBus
|
|
|
520
532
|
/// <param name="source">Source of messages to listen for.</param>
|
|
521
533
|
/// <param name="messageHandler">MessageHandler to post-process messages for.</param>
|
|
522
534
|
/// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
|
|
523
|
-
/// <returns>
|
|
524
|
-
|
|
535
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop post-processing messages.</returns>
|
|
536
|
+
MessageBusRegistration RegisterBroadcastPostProcessor<T>(
|
|
525
537
|
InstanceId source,
|
|
526
538
|
MessageHandler messageHandler,
|
|
527
539
|
int priority = 0
|
|
@@ -535,13 +547,36 @@ namespace DxMessaging.Core.MessageBus
|
|
|
535
547
|
/// <typeparam name="T">Type of TargetedMessage to post-process.</typeparam>
|
|
536
548
|
/// <param name="messageHandler">MessageHandler to post-process messages for.</param>
|
|
537
549
|
/// <param name="priority">Priority of the interceptor to run at. Handlers run in order of priority from low -> high.</param>
|
|
538
|
-
/// <returns>
|
|
539
|
-
|
|
550
|
+
/// <returns>An opaque registration handle. Pass it to <see cref="Deregister{T}"/> with the same T to stop post-processing messages.</returns>
|
|
551
|
+
MessageBusRegistration RegisterBroadcastWithoutSourcePostProcessor<T>(
|
|
540
552
|
MessageHandler messageHandler,
|
|
541
553
|
int priority = 0
|
|
542
554
|
)
|
|
543
555
|
where T : IBroadcastMessage;
|
|
544
556
|
|
|
557
|
+
/// <summary>
|
|
558
|
+
/// Undoes a registration produced by any of the <c>Register*</c> methods.
|
|
559
|
+
/// </summary>
|
|
560
|
+
/// <remarks>
|
|
561
|
+
/// <para>
|
|
562
|
+
/// Pass the <see cref="MessageBusRegistration"/> returned by the matching
|
|
563
|
+
/// <c>Register*</c> call, using the SAME <typeparamref name="T"/> you registered with
|
|
564
|
+
/// (for <see cref="RegisterGlobalAcceptAll"/>, any <c>T : IMessage</c> such as
|
|
565
|
+
/// <see cref="Messages.IMessage"/> is accepted, since the global slot is not type-keyed).
|
|
566
|
+
/// </para>
|
|
567
|
+
/// <para>
|
|
568
|
+
/// Deregistration is idempotent at the handle level only in the sense that a handle that
|
|
569
|
+
/// has outlived a reset/domain-reload, or a <see cref="MessageBusRegistration.None"/> /
|
|
570
|
+
/// foreign handle, is a silent no-op. Calling it twice for the same live registration is a
|
|
571
|
+
/// genuine over-deregistration and is logged (matching the pre-v4 behaviour of invoking
|
|
572
|
+
/// the returned deregistration action twice).
|
|
573
|
+
/// </para>
|
|
574
|
+
/// </remarks>
|
|
575
|
+
/// <typeparam name="T">The message type the registration was created for.</typeparam>
|
|
576
|
+
/// <param name="registration">The handle returned by the originating <c>Register*</c> call.</param>
|
|
577
|
+
void Deregister<T>(in MessageBusRegistration registration)
|
|
578
|
+
where T : IMessage;
|
|
579
|
+
|
|
545
580
|
/// <summary>
|
|
546
581
|
/// Broadcasts an Untargeted message to all listeners registered to this bus.
|
|
547
582
|
/// </summary>
|