-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Interprocess: Support accessing realms from multiple processes #824
Comments
I know for a fact one of our users got this working in his app (on beta5 and from Objective-C though). Let us see what we can dig up… You may want to ask around on the mailing-list with more details about your setup |
I ran into this same exact problem. The main app can read and write just fine, but once I read with the other app (an app extension), the next beginWriteTransaction() has this exact same crash. Any findings on how to fix this? |
There is currently a bug in the core library that prevents simultaneous access to a Realm from multiple processes, which is what is happening with shared containers. We are working on a fix and we will update this issue once we have a resolution. |
Running into this as well. 👍 |
Small update to inform you that multiprocess support is progressing well and still at the very top of our priority list. We hope to have more to announce soon. I've also updated the title to better reflect this issue/feature. |
VERY much appreciated. 👍 |
#1075 open() not permitted - Access from Keyboard Extension to AppGroup Shared Data seems to be a dup of this too. |
I don't suppose this will be fixed in 0.88.0 already? (The WIP release notes mention some "threading" things, but wasn't sure if it perhaps was related.) I know it's not reasonable to ask for a date, but I'm just trying to make the call to wait further, or switch to Core Data. Thanks! |
So we have some of that done in core already, with yet more to come. The good news is that basic reading/writing should be enabled very soon. Notifications won’t work across processes for a little while longer. We’re working as fast as we can but had to divert cycles onto some important bugs recently. Our apologies for the delay! |
@tgoyne are you working on this? What else do we need before we can make a pr to fix this? |
tg-interprocess is my WIP branch. It needs a core release with realm/realm-core#592 merged, and it crashes consistently on some of the tests. |
Can you see what is the cause of the crashes? Are they reproducible? And On Mon, Dec 15, 2014 at 10:09 AM, Thomas Goyne [email protected]
|
Stuff to do for full interprocess support:
|
To the last point: it worked fine for me, and with a quick and dirty infinite loop with a wait_for_change and a call to the notification sending method I could even get notifications. This only worked one way at a time, though, I didn't manage to set it up to use the same loop in both the sim and app bindings at the same time, that made it crash horribly. Without notifications it worked fine, and in both cases I could make modifications in both the app and the simulator. I used the master, the one that I think got yanked afterwards. |
I spent some time investigating sharing Realm files between the simulator and the browser yesterday. The current approach of putting a
If we go with #1 (or just punt on the whole issue), we'd also need to solve the problem of that the lock file header is different sizes on 32-bit and 64-bit. Currently trying to open a Realm file in the browser which has a lock file generated by a 32-bit simulator infinite loops, since the file is non-empty but not big enough to be a valid lock file, so it assumes that some other process is in the middle of initializing it. |
We now have support in core for multi-process, including notifications, as long as people use compatible pthread libraries. We need to wrap up the implementation of notifications at the cocoa level, and highlight what we support (iOS 8 extensions, WatchKit, …) + caveats (incompatible pthread libraries) in our docs. |
@timanglade Is this support present in v0.90.4? Seeing no query results in my Watchkit extension after committing a write transaction in the parent app. Edit: I have confirmed that multiprocess support is working in 0.90.4 |
@RTimal Some things are working yes, but right now there are no change notifications, lots of tests are missing and there’s also an Apple bug we need to address in a more elegant way. We have some builds working internally and we’ll update this ticket as we make progress :) |
This is now fully supported on master and we'll release 0.91.0 with it soon. |
Could someone provide an overview of how I could get Realm to work with an extension. I am making a WatchKit extension. |
Here you go http://fancypixel.github.io/blog/2015/03/29/share-data-between-watchkit-and-your-app-with-realm/. We are working on a tutorial as well, it should be up soon |
I get a hard crash when I try to begin a transaction on a realm that is located in a shared container. The problem only occurs if both the containing app and the app extensions tries to use the realm. Both "apps" can read from the realm just fine but calling beginWriteTransaction crashes with the output:
Not sure If I'm doing something wrong here.
Unfortunately it is quite cumbersome to replicate a clean project with the same issue since you need to create two App IDs for the App and the extension and set up a App Group too.
The text was updated successfully, but these errors were encountered: