-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Can't use Siesta on an XPC service #201
Comments
Good question. This had never even occurred to me! I'd always imagined Siesta operating within apps. The real constraint is not that all operations happen on the main thread specifically, but rather that all operations for a given service and all of its resources happen on the same thread. I know very little about XPC. Can it guarantee that your code is consistently called on the same thread / GCD queue? (Or if not, can you use GCD to single-queue operations yourself?) For the more common case of people writing apps, I don’t want to lose that main thread precondition. One approach would be to give every Any thoughts? |
I believe the answer is yes. GCD works on XPC services and I can configure a queue to run all of the networking operations.
Maybe there could be an option to disable the thread precondition? Since XPC is an advanced topic, you can assume the person using it would know the consequences. |
This might be a bit of a hack but at least its surgical and it opens up a way to specify the "main thread" for the developer. She needs to set I've not tried nor tested this. Just sharing an idea. :-)
|
I'm trying to use Siesta and all of my networking and storage code happens on an XPC service, but it always crashes because Siesta has a check for the main thread. The issue is that there's no main thread on an XPC service.
The text was updated successfully, but these errors were encountered: