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

Implement async fetching of extenal script sources via interruptible parsing. #5197

Closed
wants to merge 14 commits into from

Documentation.

  • Loading branch information
jdm committed Mar 5, 2015
commit 0215db36b220a50fc6897cf63aa73082c537408f
@@ -106,8 +106,9 @@ impl<'a> GlobalRef<'a> {
}
}

/// `ScriptChan` used to send messages to the event loop of this global's
/// thread.
/// Create a new sender/receiver pair that can be used to implement an on-demand
/// event loop. Used for implementing web APIs that require blocking semantics
/// without resorting to nested event loops.
pub fn new_script_pair(&self) -> (Box<ScriptChan+Send>, Box<ScriptPort+Send>) {
match *self {
GlobalRef::Window(ref window) => window.new_script_pair(),
@@ -180,6 +180,9 @@ pub trait ScriptChan {
fn clone(&self) -> Box<ScriptChan+Send>;
}

/// An interface for receiving ScriptMsg values in an event loop. Used for synchronous DOM
/// APIs that need to abstract over multiple kinds of event loops (worker/main thread) with
/// different Receiver interfaces.
pub trait ScriptPort {
fn recv(&self) -> ScriptMsg;
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.