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

Remove dead code: legacy read/write ops #2776

Merged
merged 3 commits into from
Aug 14, 2019
Merged

Conversation

ry
Copy link
Member

@ry ry commented Aug 14, 2019

No description provided.

@ry ry requested a review from piscisaureus August 14, 2019 15:09
@bartlomieju
Copy link
Member

@ry in //js/files.ts - readSync and writeSync still use flatbuffers

@ry
Copy link
Member Author

ry commented Aug 14, 2019

@bartlomieju thanks - fixed.

@ry ry force-pushed the remove_dead_read_write branch from 636f45f to e2ec9b7 Compare August 14, 2019 17:06
@@ -72,21 +69,23 @@ fn test_parse_min_record() {
assert_eq!(parse_min_record(&buf), None);
}

pub fn dispatch_minimal(
pub type MinimalOp = dyn Future<Item = i32, Error = ErrBox> + Send;
pub type Dispatcher = fn(i32, Option<PinnedBuf>) -> Box<MinimalOp>;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a fan of this name. I always imagined "dispatcher" as a function which maps "op id" to "op handler".

Copy link
Member Author

Choose a reason for hiding this comment

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

that's what this does (modulo the op id part)

Copy link
Member

Choose a reason for hiding this comment

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

Mmmm, I'm not sure. It looks like Dispatcher is actually an "op", it returns MinimalOp which is the result of that op. I had a feeling that it was supposed to be that Dispatcher selects MinimalOp which returns some MinimalOpResult. But that's nomenclature... just thinking out loud

Copy link
Member Author

@ry ry Aug 14, 2019

Choose a reason for hiding this comment

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

Op = Promise = Future .. there are many ops for each dispatcher. An OpDispatcher (yet to be defined but outlined in #2730) is something that returns an Op.

So I think the term Dispatcher is appropriate here. That said, I consider this bit ephemeral as I plan on adding the OpDispatcher trait soon.

Copy link
Member

@piscisaureus piscisaureus left a comment

Choose a reason for hiding this comment

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

Yes this definitely makes some hackyness a cleaner, and 'flatbuffer free' is going to become the norm not the exception.

@ry ry merged commit 498f6ad into denoland:master Aug 14, 2019
@ry ry deleted the remove_dead_read_write branch August 14, 2019 23:55
ry added a commit to ry/deno that referenced this pull request Aug 16, 2019
Seem to have caused master to go red. Cause unknown currently unknown,
see denoland#2787.

This reverts commit 498f6ad.
@ry ry restored the remove_dead_read_write branch August 16, 2019 15:37
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.

3 participants