NiccoloBargioni / ZTronProblemSolver

0 stars 0 forks source link

Invoking `solve(_:)` from a background thread as intended causes `Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:))` #1

Open NiccoloBargioni opened 6 days ago

NiccoloBargioni commented 6 days ago

Using status, say, to disable the solve button during solution computation, causes

Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:))

Because the .solve(_:) method sets the status value, but .solve(_;) in meant to be invoked from a background thread in order not to block the UI.

NiccoloBargioni commented 6 days ago

For example in ZombieTron ValvesMachineSolverView (Beast from Beyond EE).