@ -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
|
||||
|
@ -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});
|
||||
|
@ -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});
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user