Skip to content

all: smoother database module handler thread dispatching (fixes #12994)#12995

Merged
dogi merged 2 commits into
masterfrom
12994-async-query-cannot-be-created-on-current-thread
Apr 16, 2026
Merged

all: smoother database module handler thread dispatching (fixes #12994)#12995
dogi merged 2 commits into
masterfrom
12994-async-query-cannot-be-created-on-current-thread

Conversation

@Okuro3499
Copy link
Copy Markdown
Collaborator

fixes #12994
Replace the single-thread executor with a HandlerThread-backed CoroutineDispatcher so Realm async queries and change listeners run on a thread with a Looper. Starts a HandlerThread named "RealmQueryThread" and returns Handler(looper).asCoroutineDispatcher(). Removes the unused executor import and obsolete shutdown-hook comment.

Replace the single-thread executor with a HandlerThread-backed CoroutineDispatcher so Realm async queries and change listeners run on a thread with a Looper. Starts a HandlerThread named "RealmQueryThread" and returns Handler(looper).asCoroutineDispatcher(). Removes the unused executor import and obsolete shutdown-hook comment.
@dogi dogi changed the title all: use HandlerThread for Realm dispatcher (fixes #12994) all: smoother database module handler thread dispatching (fixes #12994) Apr 16, 2026
@dogi dogi merged commit dab832a into master Apr 16, 2026
3 of 4 checks passed
@Okuro3499 Okuro3499 deleted the 12994-async-query-cannot-be-created-on-current-thread branch April 20, 2026 11:14
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.

Async query cannot be created on current thread

2 participants