DelSkayn / rquickjs

High level bindings to the quickjs javascript engine
MIT License
431 stars 58 forks source link

Expose methods on spawner in the API. #313

Open DelSkayn opened 1 month ago

DelSkayn commented 1 month ago

Adds the poll_schedular and listen_spawn method.

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 74.19355% with 16 lines in your changes are missing coverage. Please review.

Project coverage is 68.37%. Comparing base (304db5d) to head (1196234).

Files Patch % Lines
core/src/runtime/schedular.rs 56.66% 13 Missing :warning:
core/src/context/ctx.rs 50.00% 3 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #313 +/- ## ========================================== + Coverage 68.31% 68.37% +0.06% ========================================== Files 83 83 Lines 12237 12299 +62 ========================================== + Hits 8360 8410 +50 - Misses 3877 3889 +12 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DelSkayn commented 3 weeks ago

Hmmm, I am still having some problems finding a good API here.

This PR has the problem that exposing poll and such introduces the ability to poll recursively: polling the scheduler from within a future currently being polled in the scheduler. The scheduler wasn't really designed with that in mind. I can add support for it but it is still hacky and I am not sure I want to expose this type of API.

richarddd commented 3 weeks ago

Hmmm, I am still having some problems finding a good API here.

This PR has the problem that exposing poll and such introduces the ability to poll recursively: polling the scheduler from within a future currently being polled in the scheduler. The scheduler wasn't really designed with that in mind. I can add support for it but it is still hacky and I am not sure I want to expose this type of API.

Thanks for the status update, I really appreciate the effort. Does this also mean that https://github.com/DelSkayn/rquickjs/pull/312 is obsolete? All current blockers goes away if promises also drove spawned tasks forward.