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

Use gotham-like state for ops #7385

Merged
merged 52 commits into from
Sep 10, 2020
Merged

Use gotham-like state for ops #7385

merged 52 commits into from
Sep 10, 2020

Conversation

ry
Copy link
Member

@ry ry commented Sep 7, 2020

Provides a concrete state type that can be dynamically added to. This is necessary for op crates.

  • renames BasicState to OpState
  • sync and async ops take Rc<RefCell<OpState>>
  • removes OpRegistry, OpRouter traits
  • move register_op(), register_op_json_sync(), register_op_json_async() back to be JsRuntime methods
  • get_error_class_fn moved to OpState

Status: deno_core tests/examples are good (cargo test -p deno_core). cli hasn't been integrated yet.

core/op_state.rs Outdated Show resolved Hide resolved
@piscisaureus
Copy link
Member

Looks good generally. The comment on the "sync op fn" signature is the only serious comment.

Also before diving deep into CLI I'd try to figure out the CLI metrics wrapper, or this could turn into a really sour experience in a couple (dozen) hours.

core/ops.rs Outdated Show resolved Hide resolved
@ry
Copy link
Member Author

ry commented Sep 8, 2020

@piscisaureus Further edits to the interface defined in core. Exposing json_op_sync and json_op_async wrappers rather than having special op registration functions for json ops. OpTable moved to JsRuntime state. deno_core is green, CLI remains unintegrated.

@ry ry changed the title WIP: use gotham-like state for ops Use gotham-like state for ops Sep 9, 2020
@ry
Copy link
Member Author

ry commented Sep 9, 2020

Seems everything is working but plugins...

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, just a few minor nitpicks

cli/metrics.rs Show resolved Hide resolved
cli/state.rs Show resolved Hide resolved
cli/state.rs Outdated Show resolved Hide resolved
cli/worker.rs Show resolved Hide resolved
@ry
Copy link
Member Author

ry commented Sep 10, 2020

@piscisaureus @bartlomieju I think this patch is ready to land. I'll be offline today, please squash and merge this once it goes green.

merged it myself

@ry ry merged commit 7c2e7c6 into denoland:master Sep 10, 2020
@ry ry deleted the gotham11 branch September 10, 2020 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants