com.wallstop-studios.dxmessaging 2.0.0-rc10 → 2.0.0-rc12

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.
Files changed (33) hide show
  1. package/Editor/SetupCscRsp.cs +29 -13
  2. package/README.md +10 -9
  3. package/Runtime/Core/Attributes/DxAutoMessageTypeAttribute.cs +2 -4
  4. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs +2 -5
  5. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs +2 -5
  6. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs +2 -5
  7. package/Runtime/Core/Extensions/MessageExtensions.cs +83 -16
  8. package/Runtime/Core/MessageBus/MessageBus.cs +74 -74
  9. package/Runtime/Core/MessageBus/MessagingRegistration.cs +9 -4
  10. package/Runtime/Core/MessageHandler.cs +44 -1
  11. package/Runtime/Core/Messages/IBroadcastMessage.cs +2 -2
  12. package/Runtime/Core/Messages/ITargetedMessage.cs +2 -1
  13. package/Runtime/Core/Messages/IUntargetedMessage.cs +2 -1
  14. package/Runtime/Core/MessagingDebug.cs +0 -1
  15. package/Runtime/Unity/MessageAwareComponent.cs +1 -1
  16. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoMessageTypeGenerator.cs +36 -19
  17. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxBroadcastMessageGenerator.cs +37 -20
  18. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxTargetedMessageGenerator.cs +37 -20
  19. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxUntargetedMessageGenerator.cs +38 -22
  20. package/Tests/Runtime/Core/GlobalAcceptAllTests.cs +32 -11
  21. package/Tests/Runtime/Core/MessagingTestBase.cs +36 -15
  22. package/Tests/Runtime/Core/NominalTests.cs +320 -98
  23. package/Tests/Runtime/Core/PostProcessorTests.cs +468 -81
  24. package/Tests/Runtime/Core/RegistrationTests.cs +390 -119
  25. package/Tests/Runtime/Scripts/Components/SimpleMessageAwareComponent.cs +62 -16
  26. package/Tests/Runtime/Scripts/Messages/ComplexTargetedMessage.cs +1 -1
  27. package/Tests/Runtime/Scripts/Messages/SimpleBroadcastMessage.cs +1 -1
  28. package/Tests/Runtime/Scripts/Messages/SimpleTargetedMessage.cs +1 -1
  29. package/Tests/Runtime/Scripts/Messages/SimpleUntargetedMessage.cs +1 -1
  30. package/Tests/Runtime/WallstopStudios.DxMessaging.Tests.Runtime.asmdef +22 -22
  31. package/package.json +2 -2
  32. package/com.wallstop-studios.dxmessaging.sln +0 -39
  33. package/com.wallstop-studios.dxmessaging.sln.meta +0 -7
@@ -13,8 +13,12 @@ namespace DxMessaging.Editor
13
13
  [InitializeOnLoad]
14
14
  public static class SetupCscRsp
15
15
  {
16
- private static readonly string RspFilePath =
17
- Path.Combine(Application.dataPath, "..", "csc.rsp").Replace("\\", "/");
16
+ private static readonly string RspFilePath = Path.Combine(
17
+ Application.dataPath,
18
+ "..",
19
+ "csc.rsp"
20
+ )
21
+ .Replace("\\", "/");
18
22
 
19
23
  private static readonly string AnalyzerPathRelative =
20
24
  "Packages/com.wallstop-studios.dxmessaging/Editor/Analyzers/";
@@ -22,14 +26,15 @@ namespace DxMessaging.Editor
22
26
  private static readonly string LibraryPathRelative =
23
27
  "Library/PackageCache/com.wallstop-studios.dxmessaging/Editor/Analyzers/";
24
28
 
25
- private static readonly string SourceGeneratorDllName = "WallstopStudios.DxMessaging.SourceGenerators.dll";
29
+ private static readonly string SourceGeneratorDllName =
30
+ "WallstopStudios.DxMessaging.SourceGenerators.dll";
26
31
 
27
32
  private static readonly string[] RequiredDllNames =
28
33
  {
29
34
  SourceGeneratorDllName,
30
35
  "Microsoft.CodeAnalysis.dll",
31
36
  "Microsoft.CodeAnalysis.CSharp.dll",
32
- "System.Reflection.Metadata.dll"
37
+ "System.Reflection.Metadata.dll",
33
38
  };
34
39
 
35
40
  private static readonly string LibraryArgument = $"-a:\"{LibraryPathRelative}\"";
@@ -43,7 +48,9 @@ namespace DxMessaging.Editor
43
48
  private static void EnsureDLLsExistInAssets()
44
49
  {
45
50
  HashSet<string> dllNames = new();
46
- foreach (string dllGuid in AssetDatabase.FindAssets("t:DefaultAsset", new[] { "Assets" }))
51
+ foreach (
52
+ string dllGuid in AssetDatabase.FindAssets("t:DefaultAsset", new[] { "Assets" })
53
+ )
47
54
  {
48
55
  string dllPath = AssetDatabase.GUIDToAssetPath(dllGuid);
49
56
  if (!dllPath.EndsWith(".dll"))
@@ -58,7 +65,11 @@ namespace DxMessaging.Editor
58
65
  string[] dllRelativeDirectories = { LibraryPathRelative, AnalyzerPathRelative };
59
66
 
60
67
  bool anyFound = false;
61
- foreach (string requiredDllName in RequiredDllNames.Where(dllName => !dllNames.Contains(dllName)))
68
+ foreach (
69
+ string requiredDllName in RequiredDllNames.Where(dllName =>
70
+ !dllNames.Contains(dllName)
71
+ )
72
+ )
62
73
  {
63
74
  bool found = false;
64
75
  foreach (string relativeDirectory in dllRelativeDirectories)
@@ -71,7 +82,8 @@ namespace DxMessaging.Editor
71
82
  continue;
72
83
  }
73
84
 
74
- const string pluginsDirectory = "Assets/Plugins/WallstopStudios.DxMessaging/";
85
+ const string pluginsDirectory =
86
+ "Assets/Plugins/WallstopStudios.DxMessaging/";
75
87
  string outputAsset = $"{pluginsDirectory}{requiredDllName}";
76
88
  Directory.CreateDirectory(pluginsDirectory);
77
89
  if (!File.Exists(outputAsset))
@@ -86,8 +98,9 @@ namespace DxMessaging.Editor
86
98
  Object loadedDll = AssetDatabase.LoadMainAssetAtPath(outputAsset);
87
99
  AssetDatabase.SetLabels(loadedDll, new[] { "RoslynAnalyzer" });
88
100
  }
89
-
90
- PluginImporter importer = AssetImporter.GetAtPath(outputAsset) as PluginImporter;
101
+
102
+ PluginImporter importer =
103
+ AssetImporter.GetAtPath(outputAsset) as PluginImporter;
91
104
  if (importer != null)
92
105
  {
93
106
  importer.SetCompatibleWithAnyPlatform(false);
@@ -100,14 +113,17 @@ namespace DxMessaging.Editor
100
113
  }
101
114
  catch (Exception e)
102
115
  {
103
- Debug.LogError($"Failed to copy {requiredDllName} to Assets, failed with {e}.");
116
+ Debug.LogError(
117
+ $"Failed to copy {requiredDllName} to Assets, failed with {e}."
118
+ );
104
119
  }
105
120
  }
106
121
 
107
122
  anyFound |= found;
108
123
  Debug.Log(
109
- $"Missing required dll '{requiredDllName}', " +
110
- $"{(found ? "creation successful." : "WARNING! Manual creation required.")}");
124
+ $"Missing required dll '{requiredDllName}', "
125
+ + $"{(found ? "creation successful." : "WARNING! Manual creation required.")}"
126
+ );
111
127
  }
112
128
 
113
129
  if (anyFound)
@@ -143,4 +159,4 @@ namespace DxMessaging.Editor
143
159
  }
144
160
  }
145
161
  }
146
- #endif
162
+ #endif
package/README.md CHANGED
@@ -3,12 +3,13 @@ Game engine agnostic robust, synchronous pub/sub C# messaging solution, mostly g
3
3
 
4
4
  # To Install as Unity Package
5
5
  1. Open Unity Package Manager
6
- 2. Open the Advanced Package Settings
7
- 3. Add an entry for a new "Scoped Registry"
6
+ 2. (Optional) Enable Pre-release packages to get the latest, cutting-edge builds
7
+ 3. Open the Advanced Package Settings
8
+ 4. Add an entry for a new "Scoped Registry"
8
9
  - Name: `NPM`
9
10
  - URL: `https://registry.npmjs.org`
10
11
  - Scope(s): `com.wallstop-studios.dxmessaging` *and* `com.wallstop-studios.unity-helpers`
11
- 4. Resolve the latest `DxMessaging`
12
+ 5. Resolve the latest `DxMessaging`
12
13
 
13
14
  # Dependencies
14
15
  This project has a dependency on my [`Unity Helpers`](https://github.com/wallstop/unity-helpers) project, which contains the `System.Runtime.CompilerServices.Unsafe.dll`, which is used for some speed hacks in DxMessaging directly. Unity Helpers bundles a few (small) dependencies, including protobuf. If you don't want these dependencies, or if they conflict in some way, you can either include a copy of the `System.Runtime.CompilerServices.Unsafe.dll` yourself without relying on UnityHelpers, or manually download and include the Unity Helpers project and delete anything that conflicts with your project. Or, manually download this project without UnityHelpers. The choice is yours.
@@ -17,12 +18,12 @@ This project has a dependency on my [`Unity Helpers`](https://github.com/wallsto
17
18
  DxMessaging is currently a bit slower (2-3x) than Unity's built in messaging solution (when running in Unity). [Source](./Tests/Runtime/Benchmarks/PerformanceTests.cs).
18
19
  | Message Tech | Operations / Second |
19
20
  | ------------ | ------------------- |
20
- | Unity | 2,101,721 |
21
- | DxMessaging (GameObject) - Normal | 889,760 |
22
- | DxMessaging (Component) - Normal | 869,437 |
23
- | DxMessaging (GameObject) - No-Copy | 871,880 |
24
- | DxMessaging (Component) - No-Copy | 899,361 |
25
- | DxMessaging (Untargeted) - No-Copy | 1,239,673 |
21
+ | Unity | 2,509,901 |
22
+ | DxMessaging (GameObject) - Normal | 1,031,034 |
23
+ | DxMessaging (Component) - Normal | 1,066,371 |
24
+ | DxMessaging (GameObject) - No-Copy | 1,001,639 |
25
+ | DxMessaging (Component) - No-Copy | 1,080,738 |
26
+ | DxMessaging (Untargeted) - No-Copy | 1,389,542 |
26
27
 
27
28
  # Functionality
28
29
  While not as fast, DxMessaging offers *additional functionality* as compared to Unity's messaging solution.
@@ -3,7 +3,5 @@
3
3
  using System;
4
4
 
5
5
  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
6
- public sealed class DxAutoMessageTypeAttribute : Attribute
7
- {
8
- }
9
- }
6
+ public sealed class DxAutoMessageTypeAttribute : Attribute { }
7
+ }
@@ -3,8 +3,5 @@
3
3
  using System;
4
4
 
5
5
  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
6
- public sealed class DxBroadcastMessageAttribute : Attribute
7
- {
8
-
9
- }
10
- }
6
+ public sealed class DxBroadcastMessageAttribute : Attribute { }
7
+ }
@@ -3,8 +3,5 @@
3
3
  using System;
4
4
 
5
5
  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
6
- public sealed class DxTargetedMessageAttribute : Attribute
7
- {
8
-
9
- }
10
- }
6
+ public sealed class DxTargetedMessageAttribute : Attribute { }
7
+ }
@@ -3,8 +3,5 @@
3
3
  using System;
4
4
 
5
5
  [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
6
- public sealed class DxUntargetedMessageAttribute : Attribute
7
- {
8
-
9
- }
10
- }
6
+ public sealed class DxUntargetedMessageAttribute : Attribute { }
7
+ }
@@ -9,7 +9,6 @@
9
9
  /// </summary>
10
10
  public static class MessageExtensions
11
11
  {
12
-
13
12
  #if UNITY_2017_1_OR_NEWER
14
13
  /// <summary>
15
14
  /// Emits a TargetedMessage of the given type.
@@ -17,7 +16,12 @@
17
16
  /// <param name="message">TargetedMessage to emit.</param>
18
17
  /// <param name="target">Target that this message is intended for.</param>
19
18
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
20
- public static void EmitGameObjectTargeted<TMessage>(this TMessage message, UnityEngine.GameObject target, IMessageBus messageBus = null) where TMessage : class, ITargetedMessage
19
+ public static void EmitGameObjectTargeted<TMessage>(
20
+ this TMessage message,
21
+ UnityEngine.GameObject target,
22
+ IMessageBus messageBus = null
23
+ )
24
+ where TMessage : class, ITargetedMessage
21
25
  {
22
26
  InstanceId targetId = target;
23
27
  messageBus ??= MessageHandler.MessageBus;
@@ -36,7 +40,12 @@
36
40
  /// <param name="message">TargetedMessage to emit.</param>
37
41
  /// <param name="target">Target that this message is intended for.</param>
38
42
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
39
- public static void EmitGameObjectTargeted<TMessage>(this ref TMessage message, UnityEngine.GameObject target, IMessageBus messageBus = null) where TMessage : struct, ITargetedMessage
43
+ public static void EmitGameObjectTargeted<TMessage>(
44
+ this ref TMessage message,
45
+ UnityEngine.GameObject target,
46
+ IMessageBus messageBus = null
47
+ )
48
+ where TMessage : struct, ITargetedMessage
40
49
  {
41
50
  InstanceId targetId = target;
42
51
  messageBus ??= MessageHandler.MessageBus;
@@ -55,7 +64,12 @@
55
64
  /// <param name="message">TargetedMessage to emit.</param>
56
65
  /// <param name="target">Target that this message is intended for.</param>
57
66
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
58
- public static void EmitComponentTargeted<TMessage>(this TMessage message, UnityEngine.Component target, IMessageBus messageBus = null) where TMessage : class, ITargetedMessage
67
+ public static void EmitComponentTargeted<TMessage>(
68
+ this TMessage message,
69
+ UnityEngine.Component target,
70
+ IMessageBus messageBus = null
71
+ )
72
+ where TMessage : class, ITargetedMessage
59
73
  {
60
74
  InstanceId targetId = target;
61
75
  messageBus ??= MessageHandler.MessageBus;
@@ -74,7 +88,12 @@
74
88
  /// <param name="message">TargetedMessage to emit.</param>
75
89
  /// <param name="target">Target that this message is intended for.</param>
76
90
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
77
- public static void EmitComponentTargeted<TMessage>(this ref TMessage message, UnityEngine.Component target, IMessageBus messageBus = null) where TMessage : struct, ITargetedMessage
91
+ public static void EmitComponentTargeted<TMessage>(
92
+ this ref TMessage message,
93
+ UnityEngine.Component target,
94
+ IMessageBus messageBus = null
95
+ )
96
+ where TMessage : struct, ITargetedMessage
78
97
  {
79
98
  InstanceId targetId = target;
80
99
  messageBus ??= MessageHandler.MessageBus;
@@ -88,14 +107,18 @@
88
107
  }
89
108
  #endif
90
109
 
91
-
92
110
  /// <summary>
93
111
  /// Emits a TargetedMessage of the given type.
94
112
  /// </summary>
95
113
  /// <param name="message">TargetedMessage to emit.</param>
96
114
  /// <param name="target">Target that this message is intended for.</param>
97
115
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
98
- public static void EmitTargeted<TMessage>(this TMessage message, InstanceId target, IMessageBus messageBus = null) where TMessage : class, ITargetedMessage
116
+ public static void EmitTargeted<TMessage>(
117
+ this TMessage message,
118
+ InstanceId target,
119
+ IMessageBus messageBus = null
120
+ )
121
+ where TMessage : class, ITargetedMessage
99
122
  {
100
123
  messageBus ??= MessageHandler.MessageBus;
101
124
  if (typeof(TMessage) == typeof(ITargetedMessage))
@@ -113,7 +136,12 @@
113
136
  /// <param name="message">TargetedMessage to emit.</param>
114
137
  /// <param name="target">Target that this message is intended for.</param>
115
138
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
116
- public static void EmitTargeted<TMessage>(this ref TMessage message, InstanceId target, IMessageBus messageBus = null) where TMessage : struct, ITargetedMessage
139
+ public static void EmitTargeted<TMessage>(
140
+ this ref TMessage message,
141
+ InstanceId target,
142
+ IMessageBus messageBus = null
143
+ )
144
+ where TMessage : struct, ITargetedMessage
117
145
  {
118
146
  messageBus ??= MessageHandler.MessageBus;
119
147
  if (typeof(TMessage) == typeof(ITargetedMessage))
@@ -130,7 +158,11 @@
130
158
  /// </summary>
131
159
  /// <param name="message">UntargetedMessage to emit.</param>
132
160
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
133
- public static void EmitUntargeted<TMessage>(this TMessage message, IMessageBus messageBus = null) where TMessage : class, IUntargetedMessage
161
+ public static void EmitUntargeted<TMessage>(
162
+ this TMessage message,
163
+ IMessageBus messageBus = null
164
+ )
165
+ where TMessage : class, IUntargetedMessage
134
166
  {
135
167
  messageBus ??= MessageHandler.MessageBus;
136
168
  if (typeof(TMessage) == typeof(IUntargetedMessage))
@@ -147,7 +179,11 @@
147
179
  /// </summary>
148
180
  /// <param name="message">UntargetedMessage to emit.</param>
149
181
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
150
- public static void EmitUntargeted<TMessage>(this ref TMessage message, IMessageBus messageBus = null) where TMessage : struct, IUntargetedMessage
182
+ public static void EmitUntargeted<TMessage>(
183
+ this ref TMessage message,
184
+ IMessageBus messageBus = null
185
+ )
186
+ where TMessage : struct, IUntargetedMessage
151
187
  {
152
188
  messageBus ??= MessageHandler.MessageBus;
153
189
  if (typeof(TMessage) == typeof(IUntargetedMessage))
@@ -166,7 +202,12 @@
166
202
  /// <param name="message">BroadcastMessage to emit.</param>
167
203
  /// <param name="source">Source of this message.</param>
168
204
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
169
- public static void EmitGameObjectBroadcast<TMessage>(this TMessage message, UnityEngine.GameObject source, IMessageBus messageBus = null) where TMessage : class, IBroadcastMessage
205
+ public static void EmitGameObjectBroadcast<TMessage>(
206
+ this TMessage message,
207
+ UnityEngine.GameObject source,
208
+ IMessageBus messageBus = null
209
+ )
210
+ where TMessage : class, IBroadcastMessage
170
211
  {
171
212
  InstanceId sourceId = source;
172
213
  messageBus ??= MessageHandler.MessageBus;
@@ -185,7 +226,12 @@
185
226
  /// <param name="message">BroadcastMessage to emit.</param>
186
227
  /// <param name="source">Source of this message.</param>
187
228
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
188
- public static void EmitGameObjectBroadcast<TMessage>(this ref TMessage message, UnityEngine.GameObject source, IMessageBus messageBus = null) where TMessage : struct, IBroadcastMessage
229
+ public static void EmitGameObjectBroadcast<TMessage>(
230
+ this ref TMessage message,
231
+ UnityEngine.GameObject source,
232
+ IMessageBus messageBus = null
233
+ )
234
+ where TMessage : struct, IBroadcastMessage
189
235
  {
190
236
  InstanceId sourceId = source;
191
237
  messageBus ??= MessageHandler.MessageBus;
@@ -204,7 +250,12 @@
204
250
  /// <param name="message">BroadcastMessage to emit.</param>
205
251
  /// <param name="source">Source of this message.</param>
206
252
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
207
- public static void EmitComponentBroadcast<TMessage>(this TMessage message, UnityEngine.Component source, IMessageBus messageBus = null) where TMessage : class, IBroadcastMessage
253
+ public static void EmitComponentBroadcast<TMessage>(
254
+ this TMessage message,
255
+ UnityEngine.Component source,
256
+ IMessageBus messageBus = null
257
+ )
258
+ where TMessage : class, IBroadcastMessage
208
259
  {
209
260
  InstanceId sourceId = source;
210
261
  messageBus ??= MessageHandler.MessageBus;
@@ -223,7 +274,12 @@
223
274
  /// <param name="message">BroadcastMessage to emit.</param>
224
275
  /// <param name="source">Source of this message.</param>
225
276
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
226
- public static void EmitComponentBroadcast<TMessage>(this ref TMessage message, UnityEngine.Component source, IMessageBus messageBus = null) where TMessage : struct, IBroadcastMessage
277
+ public static void EmitComponentBroadcast<TMessage>(
278
+ this ref TMessage message,
279
+ UnityEngine.Component source,
280
+ IMessageBus messageBus = null
281
+ )
282
+ where TMessage : struct, IBroadcastMessage
227
283
  {
228
284
  InstanceId sourceId = source;
229
285
  messageBus ??= MessageHandler.MessageBus;
@@ -236,13 +292,19 @@
236
292
  messageBus.SourcedBroadcast(ref sourceId, ref message);
237
293
  }
238
294
  #endif
295
+
239
296
  /// <summary>
240
297
  /// Emits a BroadcastMessage of the given type from the specified component.
241
298
  /// </summary>
242
299
  /// <param name="message">BroadcastMessage to emit.</param>
243
300
  /// <param name="source">Source of this message.</param>
244
301
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
245
- public static void EmitBroadcast<TMessage>(this TMessage message, InstanceId source, IMessageBus messageBus = null) where TMessage : class, IBroadcastMessage
302
+ public static void EmitBroadcast<TMessage>(
303
+ this TMessage message,
304
+ InstanceId source,
305
+ IMessageBus messageBus = null
306
+ )
307
+ where TMessage : class, IBroadcastMessage
246
308
  {
247
309
  messageBus ??= MessageHandler.MessageBus;
248
310
  if (typeof(TMessage) == typeof(IBroadcastMessage))
@@ -260,7 +322,12 @@
260
322
  /// <param name="message">BroadcastMessage to emit.</param>
261
323
  /// <param name="source">Source of this message.</param>
262
324
  /// <param name="messageBus">MessageBus to emit to. If null, uses the GlobalMessageBus.</param>
263
- public static void EmitBroadcast<TMessage>(this ref TMessage message, InstanceId source, IMessageBus messageBus = null) where TMessage : struct, IBroadcastMessage
325
+ public static void EmitBroadcast<TMessage>(
326
+ this ref TMessage message,
327
+ InstanceId source,
328
+ IMessageBus messageBus = null
329
+ )
330
+ where TMessage : struct, IBroadcastMessage
264
331
  {
265
332
  messageBus ??= MessageHandler.MessageBus;
266
333
  if (typeof(TMessage) == typeof(IBroadcastMessage))