diff --git a/MobiusCore/Source/EffectHandlers/EffectRouter.swift b/MobiusCore/Source/EffectHandlers/EffectRouter.swift index 7bbf5ec6..540b7ea9 100644 --- a/MobiusCore/Source/EffectHandlers/EffectRouter.swift +++ b/MobiusCore/Source/EffectHandlers/EffectRouter.swift @@ -107,8 +107,13 @@ public struct _PartialEffectRouter { /// Handle an the current `Effect` asynchronously on the provided `DispatchQueue` /// + /// Warning: Dispatching events to a loop from a different queue is not a thread-safe operation and will require + /// manual synchronization unless the loop is run in a `MobiusController`. + /// See: [Using MobiusController](https://github.com/spotify/Mobius.swift/wiki/Using-MobiusController). + /// + /// /// - Parameter queue: The `DispatchQueue` that the current `Effect` should be handled on. - public func on(_ queue: DispatchQueue) -> Self { + public func on(queue: DispatchQueue) -> Self { return Self(routes: routes, path: path, queue: queue) } } diff --git a/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift b/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift index a14d9ad0..4cbf15b0 100644 --- a/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift +++ b/MobiusCore/Test/EffectHandlers/EffectRouterTests.swift @@ -212,7 +212,7 @@ class EffectRouterTests: QuickSpec { var ranOnTestQueue = false let connection = EffectRouter() .routeCase(.effect1) - .on(testQueue) + .on(queue: testQueue) .to { dispatchPrecondition(condition: .onQueue(testQueue)) ranOnTestQueue = true