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

GRDB 7: MainActor ValueObservation scheduling #1633

Merged
merged 4 commits into from
Sep 21, 2024

Conversation

groue
Copy link
Owner

@groue groue commented Sep 21, 2024

The default ValueObservation scheduling is now .mainActor, which has database change callbacks run on the main actor:

let observation = ValueObservation.tracking { ... }

let cancellable = observation.start(in: dbQueue { error in
    // Handle error on the main actor
} onChange: { value in
    // Handle fresh value on the main actor
}

@groue groue force-pushed the dev/GRDB7-ValueObservation-async-sequence branch 2 times, most recently from a53234b to 403bbd6 Compare September 21, 2024 10:16
…s and errors on the cooperative thread pool by default.
@groue groue force-pushed the dev/GRDB7-ValueObservation-async-sequence branch from 403bbd6 to f6f6d0e Compare September 21, 2024 10:20
Breaking because before iOS 13, macOS 10.15, tvOS 13, there is no longer any default scheduler
@groue groue force-pushed the dev/GRDB7-ValueObservation-async-sequence branch from f6f6d0e to 1649636 Compare September 21, 2024 10:31
@groue groue merged commit f794d98 into GRDB7 Sep 21, 2024
8 checks passed
@groue groue deleted the dev/GRDB7-ValueObservation-async-sequence branch September 21, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant