Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Store] Use MainActomaton #65

Merged
merged 2 commits into from Jul 17, 2022
Merged

[Store] Use MainActomaton #65

merged 2 commits into from Jul 17, 2022

Conversation

inamiy
Copy link
Member

@inamiy inamiy commented Jul 17, 2022

Successor of:

Overview

This PR replaces Store's usage of actor Actomaton with @MainActor class MainActomaton which is introduced in #64 for:

  1. Simplifying APIs, removing [Store] Add StoreConfiguration #40 StoreConfiguration
  2. Enhanced state updates to be applied to SwiftUI views
    • Existing approach using non-main-thread actor Actomaton may sometimes cause old state updates when:
      1. setting StoreConfiguration.updatesStateImmediately = true and
      2. state updates occur in high frequency.

Issue 2b. has been observed when performing Actomaton-Gallery's LineCollisionExample which runs in 60 frames per seconds (by timer) + additional user-object-dragging, that led to too high update frequency.
While Store could update states on main-thread immediately by updatesStateImmediately = true, non-main-thread Actomaton may send older state back to Store due to slow operation, so this caused the malformed state update onto UI.

@inamiy inamiy added the enhancement New feature or request label Jul 17, 2022
@inamiy inamiy added this to the 0.7.0 milestone Jul 17, 2022
@inamiy inamiy self-assigned this Jul 17, 2022
Base automatically changed from Actomaton/MainActomaton to main July 17, 2022 13:27
@inamiy inamiy merged commit d9a5a16 into main Jul 17, 2022
@inamiy inamiy deleted the Store/use-MainActomaton branch July 17, 2022 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant