Skip to content
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

[Merged by Bors] - Allow passing owned HostHooks and JobQueues to Context #2811

Closed
wants to merge 5 commits into from

Conversation

jedel1043
Copy link
Member

@jedel1043 jedel1043 commented Apr 11, 2023

This allows thread_local contexts to have owned HostHooks and JobQueues.

It changes the following:

  • Creates a new MaybeShared struct that can hold either a reference or an Rc.
  • Changes the job_queue and host_hooks parameters of Context to use MaybeShared.

This PR also allows us to make SimpleJobQueue the default promise runner, which I think it's pretty cool :)

cc @lastmjs

@jedel1043 jedel1043 added execution Issues or PRs related to code execution API labels Apr 11, 2023
@jedel1043 jedel1043 added this to the v0.17.0 milestone Apr 11, 2023
@github-actions
Copy link

Test262 conformance changes

Test result main count PR count difference
Total 94,781 94,781 0
Passed 71,489 71,489 0
Ignored 17,824 17,824 0
Failed 5,468 5,468 0
Panics 0 0 0
Conformance 75.43% 75.43% 0.00%

@codecov
Copy link

codecov bot commented Apr 11, 2023

Codecov Report

Merging #2811 (a4d7c06) into main (2f580bb) will decrease coverage by 0.21%.
The diff coverage is 65.71%.

@@            Coverage Diff             @@
##             main    #2811      +/-   ##
==========================================
- Coverage   51.31%   51.11%   -0.21%     
==========================================
  Files         416      417       +1     
  Lines       41213    41517     +304     
==========================================
+ Hits        21149    21221      +72     
- Misses      20064    20296     +232     
Impacted Files Coverage Δ
boa_cli/src/main.rs 0.80% <0.00%> (ø)
boa_engine/src/builtins/intl/locale/utils.rs 50.34% <ø> (ø)
boa_engine/src/context/hooks.rs 70.83% <ø> (ø)
boa_engine/src/job.rs 51.92% <ø> (ø)
boa_engine/src/lib.rs 78.20% <ø> (ø)
boa_engine/src/object/builtins/jspromise.rs 0.00% <ø> (ø)
boa_examples/src/bin/futures.rs 0.00% <0.00%> (ø)
boa_tester/src/exec/mod.rs 0.00% <0.00%> (ø)
boa_engine/src/context/mod.rs 44.89% <58.82%> (-2.78%) ⬇️
boa_engine/src/context/icu.rs 39.58% <100.00%> (ø)
... and 1 more

... and 25 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!! Thanks!

I just had a small suggestion :)

boa_engine/src/context/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me! :)

@jedel1043
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Apr 12, 2023
This allows `thread_local` contexts to have owned `HostHooks` and `JobQueues`.

It changes the following:

- Creates a new `MaybeShared` struct that can hold either a reference or an `Rc`.
- Changes the `job_queue` and `host_hooks` parameters of `Context` to use `MaybeShared`.

This PR also allows us to make `SimpleJobQueue` the default promise runner, which I think it's pretty cool :)

cc @lastmjs
@bors
Copy link

bors bot commented Apr 12, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Allow passing owned HostHooks and JobQueues to Context [Merged by Bors] - Allow passing owned HostHooks and JobQueues to Context Apr 12, 2023
@bors bors bot closed this Apr 12, 2023
@bors bors bot deleted the owned-hooks branch April 12, 2023 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API execution Issues or PRs related to code execution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants