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

Testing a tokio hack #2071

Open
wants to merge 2 commits into
base: master
from

Conversation

2 participants
@piscisaureus
Copy link
Collaborator

commented Apr 8, 2019

No description provided.

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch from 1e289c8 to 0640b9f Apr 8, 2019

@piscisaureus

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 8, 2019

@piscisaureus

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 8, 2019

8269ca8 is also good and more minimal: https://travis-ci.com/denoland/deno/jobs/191039943#L2180. It was indeed the hyper hack that made it fast.

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch 7 times, most recently from 405d233 to e93c49e Apr 8, 2019

@ry

This comment has been minimized.

Copy link
Collaborator

commented Apr 8, 2019

Sorry can you explain what you’ve discovered? I don’t follow.

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch from e93c49e to ced4f9d Apr 8, 2019

use std::sync::{Arc, Mutex, Once, ONCE_INIT};

pub type Buf = Box<[u8]>;
pub type Op = dyn Future<Item = Buf, Error = ()> + Send;

pub trait Op: Future + Debug + Sized + Send {

This comment has been minimized.

Copy link
@ry

ry Apr 8, 2019

Collaborator

change to: trait Op: Future<Item=Buf, Error=()> + Debug + Sized + Send

) -> Self;
}

pub struct BoxOp<I, E> {

This comment has been minimized.

Copy link
@ry

ry Apr 8, 2019

Collaborator

Shouldn't be generic

}

pub struct BoxOp<I, E> {
pub label: &'static str,

This comment has been minimized.

Copy link
@ry

ry Apr 8, 2019

Collaborator

This might raise some eyebrows but seems fine after I thought about it for a second. We statically branch on ops. I don't think we need to enable people to have dynamic ops.

Consider adding a comment.

}

impl<I, E> Op for BoxOp<I, E> {
fn new<F: Future<Item = I, Error = E> + Send + 'static>(

This comment has been minimized.

Copy link
@ry

ry Apr 8, 2019

Collaborator

I would organize this differently. Just have the name be part of Behavior::dispatch's return value and move name reference to PendingOp.

Also should not be generic.

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch 11 times, most recently from d6abba2 to 861c64c Apr 9, 2019

@piscisaureus

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 11, 2019

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch 2 times, most recently from 6064a97 to 0e96874 Apr 15, 2019

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch 5 times, most recently from 6b23be2 to 5d70d49 Apr 15, 2019

@@ -94,7 +93,6 @@ def main(argv):

unit_tests(deno_exe)

prefetch_test(deno_exe)

This comment has been minimized.

Copy link
@ry

ry Apr 15, 2019

Collaborator

?

zero_copy_id: usize, // non-zero if associated zero-copy buffer.
}

struct OpResult {

This comment has been minimized.

Copy link
@ry

ry Apr 15, 2019

Collaborator

Hmm - "OpResult" isn't such a good name because it reminds me of "Result"
"BufAndZeroCopyId" is not great either...


pub trait Op: Future<Item = Buf, Error = ()> + Debug + Send {
fn box_op(self) -> Box<dyn Op>;
}

This comment has been minimized.

Copy link
@ry

ry Apr 15, 2019

Collaborator

I don't understand the reason for this? seems the original Op was simpler

pub type Op = dyn Future<Item = Buf, Error = ()> + Send;
pub struct Tagged<F> {
future: F,
tag: &'static str,
}

This comment has been minimized.

Copy link
@ry

ry Apr 15, 2019

Collaborator

Is this used outside the context of Ops?

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch 4 times, most recently from 9303bc5 to c31c7b9 Apr 15, 2019

piscisaureus added some commits Apr 15, 2019

@piscisaureus piscisaureus force-pushed the piscisaureus:tokio_hack branch from c31c7b9 to c9ebe45 Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.