Skip to content

Async callbacks & multi-isolate store access #145

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

Merged
merged 25 commits into from
Feb 25, 2021
Merged

Async callbacks & multi-isolate store access #145

merged 25 commits into from
Feb 25, 2021

Conversation

vaind
Copy link
Contributor

@vaind vaind commented Nov 7, 2020

The changes necessary are pretty simple - just allow creating Store from an existing OBX_Store C pointer and pass that between isolates. Any ideas how to improve/simplify that for users? I don't really know the most common isolates' usage patterns in Dart/Flutter yet so I'm open to suggestions.

However, to get it working, we had to do some custom stuff to send handle async callbacks (issue #142) - objectbox-c now (v0.12+) includes dart-specific functionality to connect to a dart runtime and send callback data over streams. This required a rework of the observers.

Besides the above, this PR also implements sync listeners.

@Buggaboo
Copy link
Contributor

Buggaboo commented Nov 9, 2020

Good solution!

@vaind vaind force-pushed the async-and-isolates branch 2 times, most recently from 76ed6ce to 713b4f4 Compare November 26, 2020 16:54
@vaind vaind changed the title Store access from multiple isolates Async callbacks & multi-isolate store access Nov 26, 2020
@vaind vaind mentioned this pull request Nov 27, 2020
@vaind vaind force-pushed the async-and-isolates branch from 713b4f4 to 112d995 Compare November 27, 2020 17:47
@vaind vaind force-pushed the async-and-isolates branch 3 times, most recently from 04c8be9 to 860c8ea Compare December 7, 2020 22:57
@greenrobot-team
Copy link
Member

LGTM as far as I understand (no deep knowledge of streams and isolates; only had a glimpse at C API for Dart).

@vaind vaind force-pushed the async-and-isolates branch 2 times, most recently from 83bc0e4 to ba44326 Compare January 26, 2021 16:42
@vaind vaind force-pushed the async-and-isolates branch from ba44326 to 054a345 Compare February 4, 2021 21:07
@vaind vaind added this to the 1.0 milestone Feb 5, 2021
@greenrobot greenrobot modified the milestones: 1.0, 0.12.0 Feb 11, 2021
@vaind vaind force-pushed the async-and-isolates branch from 4f3aa6a to 6bef12c Compare February 24, 2021 15:02
@vaind vaind force-pushed the async-and-isolates branch from 6bef12c to 46b64b4 Compare February 24, 2021 16:17
@vaind vaind force-pushed the async-and-isolates branch from c3d6c89 to b1f49a2 Compare February 25, 2021 09:33
@vaind vaind force-pushed the async-and-isolates branch from b1f49a2 to 035441a Compare February 25, 2021 09:40
@vaind vaind marked this pull request as ready for review February 25, 2021 09:49
@vaind vaind merged commit bcddecc into main Feb 25, 2021
@vaind vaind deleted the async-and-isolates branch February 25, 2021 09:51
@vaind vaind mentioned this pull request Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants