You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The warning should not appear, because SwiftRex always calls IO in main thread.
The problem is
Swift does not know SwiftRex will always call IO in main thread.
And IO class itself does not enforce this rule.
I think SwiftRex need a MainIO class, which is guaranteed to run in main thread, but it is going to be a breaking change.
The text was updated successfully, but these errors were encountered:
The problem is that we should not assume IO runs on the main thread. We could run IO in a background process, or IO itself could start a background task and even dispatch actions from whatever thread to the store. The reducer MUST run on main queue, because it's dealing with the state (shared resource), that's for sure. And the only reason the actions go to the main queue is to ensure FIFO rule, but they could be actually in any serial queue.
So I'm wondering if we should start enforcing IO to be in the main queue explicitly or not. The Store could be a main actor, and the IO could run on an attached Task. But I'm not sure if this complexity will benefit SwiftRex, but it may be necessary once I finish the Modern Concurrency version of SwiftRex, where either Combine or AsyncStream/Task can be used for creating IO middlewares.
Let me know your opinion on that.
The warning should not appear, because SwiftRex always calls IO in main thread.
The problem is
Swift does not know SwiftRex will always call IO in main thread.
And IO class itself does not enforce this rule.
I think SwiftRex need a MainIO class, which is guaranteed to run in main thread, but it is going to be a breaking change.
The text was updated successfully, but these errors were encountered: