The goog.gears.WorkerChannel Class

goog.gears.WorkerChannel
> goog.messaging.AbstractChannel
> goog.Disposable

goog.gears.WorkerChannel(worker)

Creates a message channel for the given Gears worker.

worker {goog.gears.Worker}
The Gears worker to communicate with. This should already be initialized.

.FLAG {string}

The flag added to messages that are sent by a GearsWorkerChannel, and are meant to be handled by one on the other side.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.connect()

Inherited from goog.messaging.AbstractChannel .

Immediately calls opt_connectCb if given, and is otherwise a no-op. If subclasses have configuration that needs to happen before the channel is connected, they should override this and {@link #isConnected}.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.isConnected()

Inherited from goog.messaging.AbstractChannel .

Always returns true. If subclasses have configuration that needs to happen before the channel is connected, they should override this and {@link #connect}.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.peerOrigin {?string}

The expected origin of the other end of the worker channel, represented as a string of the form SCHEME://DOMAIN[:PORT]. The port may be omitted for standard ports (http port 80, https port 443). If this is set, all GearsWorkerChannel messages are validated to come from this origin, and ignored (with a warning) if they don't. Messages that aren't in the GearsWorkerChannel format are not validated. If more complex origin validation is required, the checkMessageOrigin method can be overridden.

.registerDefaultService()

Inherited from goog.messaging.AbstractChannel .

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.registerService()

Inherited from goog.messaging.AbstractChannel .

.send()