Using Rhino with kotlin and coroutines #1596
Closed
karel-zabloudil-3pg
started this conversation in
General
Replies: 1 comment 4 replies
-
I'm not very familiar with how they work, but Rhino itself supports continuations to stop a script mid-way through and resume it later. I'm not very familiar with kotlin coroutines either, but I would venture to guess that they would not suspend and switch contexts in the middle of executing a rhino script as executing a script would be a single statement from kotlin's point-of-view. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to use Rhino with kotlin and coroutines ? Here is my use case. I want to run multiple scripts simultaneously using coroutines. Each script could call java/kotlin code which would read data from kotlin channel which could eventually suspend the coroutine. Due to nature of coroutines, the thread which run the suspended coroutine could be used to run another coroutine and another resumed script. That thread could be even completely different from the one which started the script.
Is this something which can be done with Rhino ? I'm afraid of possible synchronization and deadlock issues.
Beta Was this translation helpful? Give feedback.
All reactions