-
Notifications
You must be signed in to change notification settings - Fork 25
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
Multithreading #134
Comments
Hi @notEvil, The HttpServer was not posting the data in the message queue because IIRC I had some issues with long data transfers. If you find a better way I will be happy to accept a PR to improve it :) |
I agree, one shouldn't be concerned about threads and On a side note: just tested and confirmed my suspicion. Sensor callbacks are called by the main thread (using |
Yes, I agree. If you want you can add some documentation in the method itself or if you want you can add something to the Github wik as .md that I can include also in the websitei. I will be happy to add more docs. I just never had the time. I think this is a great opportunity to improve it. |
So you had the thread wait for the response at some point? Thats what I would do, and in case of large responses triggering the request timeout, it is still possible to do it asynchronously (e.g. respond nothing and do a request in the other direction). |
Hi,
whats the stance regarding multithreading? It seems that sometimes callbacks are deliberately pushed to the message queue, like
PHONK/PHONK-android/phonk_apprunner/src/main/java/io/phonk/runner/apprunner/api/network/PBluetoothLEClient.java
Line 190 in 6afdc85
PHONK/PHONK-android/phonk_apprunner/src/main/java/io/phonk/runner/apprunner/api/network/PHttpServer.java
Line 165 in 6afdc85
or any sensor callback. From what I found, Rhino doesn't guarantee thread safety, so I guess the intended rule is to always push JS callbacks to the message queue, if necessary (sensors?).
If thats the case, I could scan the codebase for callbacks that potentially get called on a different thread, like the one in
PHttpServer
, and prepare a PR.The text was updated successfully, but these errors were encountered: