-
Notifications
You must be signed in to change notification settings - Fork 0
Reference Faq
github-actions[bot] edited this page May 7, 2026
·
4 revisions
..-Getting-Started | Troubleshooting | ..-Getting-Started-Getting-Started | Glossary
- No. You can implement
IUntargetedMessage<T>,ITargetedMessage<T>, orIBroadcastMessage<T>directly (recommended for structs). Attributes are optional and help tooling/source-gen.
- Untargeted - global notifications (any listener).
- Targeted - commands/events for a specific recipient.
- Broadcast - facts emitted from a source that others may observe.
- Use the
priorityparameter at registration; lower runs earlier. Interceptors run before handlers; post-processors run after.
- Yes. Use
RegisterTargetedWithoutTargeting<T>orRegisterBroadcastWithoutSource<T>(and their post-processor counterparts).
- Enable logs and diagnostics: ..-Guides-Diagnostics.
The most common cause is forgetting to call base.Awake() (or base.OnEnable(), base.OnDisable(), base.OnDestroy(), base.RegisterMessageHandlers()) when you override one of those methods. The framework's setup runs in those base calls; without them, your registration token is never created or your handlers never enable. The Roslyn analyzer flags this as DXMSG006. See ..-Getting-Started-Quick-Start#important-inheritance-and-base-calls for the full list of guarded methods.
- The newly registered listener will not run for the current message emission. It will only become active starting with the next message emission.
- This is called "snapshot semantics" -- when a message is emitted, DxMessaging takes a snapshot of all current listeners and uses that frozen list for the entire emission.
- This applies to all listener types (handlers, interceptors, post-processors) and all message categories (Untargeted, Targeted, Broadcast).
- This behavior prevents infinite loops and ensures predictable execution order. See ..-Concepts-Interceptors-And-Ordering#snapshot-semantics-frozen-listener-lists for details and examples.
- A global bus is provided (
MessageHandler.MessageBus). You can also create and pass your ownMessageBusinstance to isolate subsystems and tests.
- Yes. You can integrate with legacy patterns via
ReflexiveMessage. Prefer DxMessaging for new code.
- Each scene introduces new
InstanceIds and sometimes new message types, which add empty slots on the bus when their handlers tear down. Idle eviction will reclaim them eventually; for deterministic cleanup callMessageHandler.TrimAll(force: true)on scene unload (orbus.Trim(force: true)for a non-global bus). See the ..-Guides-Memory-Reclamation for the full pattern.
-
New to DxMessaging?
- to ..-Getting-Started-Visual-Guide -- Beginner-friendly introduction
- to ..-Getting-Started-Getting-Started -- Complete guide
- to Glossary -- All terms explained
-
Common Issues
- to Troubleshooting -- Solutions to common problems
- to ..-Guides-Patterns -- See how to use it correctly
-
Reference
- to Quick-Reference -- API cheat sheet
- to ..-Concepts-Message-Types -- Which type to use when
- Getting-Started-Overview
- Getting-Started-Getting-Started
- Getting-Started-Install
- Getting-Started-Quick-Start
- Getting-Started-Visual-Guide
- Concepts-Message-Types
- Concepts-Listening-Patterns
- Concepts-Targeting-And-Context
- Concepts-Interceptors-And-Ordering
- Guides-Patterns
- Guides-Unity-Integration
- Guides-Testing
- Guides-Diagnostics
- Guides-Advanced
- Guides-Migration-Guide
- Advanced-Emit-Shorthands
- Advanced-Message-Bus-Providers
- Advanced-Runtime-Configuration
- Advanced-String-Messages
- Reference-Reference
- Reference-Quick-Reference
- Reference-Helpers
- Reference-Faq
- Reference-Glossary
- Reference-Troubleshooting
- Reference-Compatibility
Links