File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,9 +119,10 @@ internal final class DatadogCore {
119119 // the bus will keep a weak ref to the core.
120120 bus. connect ( core: self )
121121
122- // forward any context change on the typed message-bus
122+ // forward any context change on the message-bus
123123 self . contextProvider. publish { [ weak self] context in
124- self ? . bus. send ( message: context)
124+ self ? . bus. send ( message: context) // typed bus (new receivers)
125+ self ? . send ( message: . context( context) ) // legacy bus (receivers pending migration)
125126 }
126127 }
127128
@@ -264,9 +265,8 @@ internal final class DatadogCore {
264265 /// - key: The key associated with the receiver.
265266 private func add( messageReceiver: FeatureMessageReceiver , forKey key: String ) {
266267 bus. connect ( messageReceiver, forKey: key)
267- // Push current context to typed-bus DatadogContext subscribers.
268268 contextProvider. read { context in
269- self . bus. send ( message: context)
269+ self . bus. queue . async { messageReceiver . receive ( message: . context( context ) , from : self ) }
270270 }
271271 }
272272
You can’t perform that action at this time.
0 commit comments