use remote-event task source in EventSource

This commit is contained in:
Gregory Terzian 2018-07-12 23:13:50 +08:00
parent f66c9b6160
commit baef63becd
7 changed files with 81 additions and 8 deletions

View file

@ -46,6 +46,7 @@ use task::TaskCanceller;
use task_source::file_reading::FileReadingTaskSource;
use task_source::networking::NetworkingTaskSource;
use task_source::performance_timeline::PerformanceTimelineTaskSource;
use task_source::remote_event::RemoteEventTaskSource;
use time::precise_time_ns;
use timers::{IsInterval, TimerCallback};
@ -385,6 +386,10 @@ impl WorkerGlobalScope {
PerformanceTimelineTaskSource(self.script_chan(), self.pipeline_id())
}
pub fn remote_event_task_source(&self) -> RemoteEventTaskSource {
RemoteEventTaskSource(self.script_chan(), self.pipeline_id())
}
pub fn new_script_pair(&self) -> (Box<ScriptChan + Send>, Box<ScriptPort + Send>) {
let dedicated = self.downcast::<DedicatedWorkerGlobalScope>();
if let Some(dedicated) = dedicated {