Refactor(WebWorker): Unify WebWorker naming

Closes #3205
This commit is contained in:
jteplitz
2015-08-07 13:17:54 -07:00
committed by Jason Teplitz
parent 84463cf0bd
commit a1c53eec6b
25 changed files with 169 additions and 160 deletions

View File

@ -1,7 +1,7 @@
library angular2.examples.message_broker.background_index;
import "package:angular2/src/web-workers/worker/application.dart"
show WorkerMessageBus, WorkerMessageBusSource, WorkerMessageBusSink;
show WebWorkerMessageBus;
import "package:angular2/src/web-workers/worker/broker.dart"
show MessageBroker, UiArguments;
import "package:angular2/src/web-workers/shared/serializer.dart"
@ -11,7 +11,7 @@ import "dart:isolate";
main(List<String> args, SendPort replyTo) {
ReceivePort rPort = new ReceivePort();
WorkerMessageBus bus = new WorkerMessageBus.fromPorts(replyTo, rPort);
WebWorkerMessageBus bus = new WebWorkerMessageBus.fromPorts(replyTo, rPort);
bus.source.addListener((message) {
if (identical(message['data']['type'], "echo")) {
bus.sink

View File

@ -1,13 +1,13 @@
import {
WorkerMessageBus,
WorkerMessageBusSource,
WorkerMessageBusSink
WebWorkerMessageBus,
WebWorkerMessageBusSource,
WebWorkerMessageBusSink
} from "angular2/src/web-workers/worker/application";
import {MessageBroker, UiArguments} from "angular2/src/web-workers/worker/broker";
import {Serializer} from "angular2/src/web-workers/shared/serializer";
export function main() {
var bus = new WorkerMessageBus(new WorkerMessageBusSink(), new WorkerMessageBusSource());
var bus = new WebWorkerMessageBus(new WebWorkerMessageBusSink(), new WebWorkerMessageBusSource());
bus.source.addListener((message) => {
if (message.data.type === "echo") {
bus.sink.send({type: "echo_response", 'value': message.data.value});

View File

@ -1,13 +1,13 @@
library angular2.examples.message_broker.index;
import "package:angular2/src/web-workers/ui/application.dart"
show spawnWorker, UIMessageBus, UIMessageBusSink, UIMessageBusSource;
show spawnWebWorker, UIMessageBus, UIMessageBusSink, UIMessageBusSource;
import "dart:html";
main() {
var VALUE = 5;
spawnWorker(Uri.parse("background_index.dart")).then((bus) {
spawnWebWorker(Uri.parse("background_index.dart")).then((bus) {
querySelector("#send_echo").addEventListener("click", (e) {
var val = (querySelector("#echo_input") as InputElement).value;
bus.sink.send({'type': 'echo', 'value': val});

View File

@ -3,11 +3,11 @@ library examples.src.web_workers.images.background_index;
import "index_common.dart" show ImageDemo;
import "dart:isolate";
import "package:angular2/src/web-workers/worker/application.dart"
show bootstrapWebworker;
show bootstrapWebWorker;
import "package:angular2/src/reflection/reflection_capabilities.dart";
import "package:angular2/src/reflection/reflection.dart";
main(List<String> args, SendPort replyTo) {
reflector.reflectionCapabilities = new ReflectionCapabilities();
bootstrapWebworker(replyTo, ImageDemo).catchError((error) => throw error);
bootstrapWebWorker(replyTo, ImageDemo).catchError((error) => throw error);
}

View File

@ -1,6 +1,6 @@
import {bootstrapWebworker} from "angular2/src/web-workers/worker/application";
import {bootstrapWebWorker} from "angular2/src/web-workers/worker/application";
import {ImageDemo} from "./index_common";
export function main() {
bootstrapWebworker(ImageDemo);
bootstrapWebWorker(ImageDemo);
}

View File

@ -3,11 +3,11 @@ library examples.src.web_workers.kitchen_sink.background_index;
import "index_common.dart" show HelloCmp;
import "dart:isolate";
import "package:angular2/src/web-workers/worker/application.dart"
show bootstrapWebworker;
show bootstrapWebWorker;
import "package:angular2/src/reflection/reflection_capabilities.dart";
import "package:angular2/src/reflection/reflection.dart";
main(List<String> args, SendPort replyTo) {
reflector.reflectionCapabilities = new ReflectionCapabilities();
bootstrapWebworker(replyTo, HelloCmp).catchError((error) => throw error);
bootstrapWebWorker(replyTo, HelloCmp).catchError((error) => throw error);
}

View File

@ -1,6 +1,6 @@
import {HelloCmp} from "./index_common";
import {bootstrapWebworker} from "angular2/src/web-workers/worker/application";
import {bootstrapWebWorker} from "angular2/src/web-workers/worker/application";
export function main() {
bootstrapWebworker(HelloCmp);
bootstrapWebWorker(HelloCmp);
}

View File

@ -3,11 +3,11 @@ library examples.src.web_workers.todo.background_index;
import "index_common.dart" show TodoApp;
import "dart:isolate";
import "package:angular2/src/web-workers/worker/application.dart"
show bootstrapWebworker;
show bootstrapWebWorker;
import "package:angular2/src/reflection/reflection_capabilities.dart";
import "package:angular2/src/reflection/reflection.dart";
main(List<String> args, SendPort replyTo) {
reflector.reflectionCapabilities = new ReflectionCapabilities();
bootstrapWebworker(replyTo, TodoApp).catchError((error) => throw error);
bootstrapWebWorker(replyTo, TodoApp).catchError((error) => throw error);
}

View File

@ -1,6 +1,6 @@
import {bootstrapWebworker} from "angular2/src/web-workers/worker/application";
import {bootstrapWebWorker} from "angular2/src/web-workers/worker/application";
import {TodoApp} from "./index_common";
export function main() {
bootstrapWebworker(TodoApp);
bootstrapWebWorker(TodoApp);
}