Package org.angular.ts.ng
Interface WorkerHandle<TSend,TReceive>
@JsType(isNative=true,
name="ng.WorkerHandle",
namespace="<global>")
public interface WorkerHandle<TSend,TReceive>
Public AngularTS WorkerHandle contract exposed through the global ng namespace for Closure-annotated applications.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceTypeScript callback contract for this method.static interfaceTypeScript callback contract for this method.static interfaceTypeScript callback contract for this method. -
Method Summary
Modifier and TypeMethodDescriptiongetError()Latest managed failure, retained across worker replacement.doubleNumber of explicit or automatic worker restarts.Current managed lifecycle state.<T> ModelSyncTarget<T> Adapt this handle to the standard model synchronization contract.onError(WorkerHandle.OnErrorListener listener) Subscribe to runtime, message, decoding, and request failures.onMessage(WorkerHandle.OnMessageListener<TReceive> listener) Subscribe to decoded worker messages.voidSend a typed message and optional transferable ownership list.elemental2.promise.Promise<TReceive> request(TSend message, WorkerRequestOptions options) Send a correlated request using the AngularTS worker envelope.voidrestart()Replace the native worker unless this connection was terminated.voidsetError(WorkerError error) Latest managed failure, retained across worker replacement.voidsetRestartCount(double restartCount) Number of explicit or automatic worker restarts.voidCurrent managed lifecycle state.voidPermanently terminate this managed connection.
-
Method Details
-
getError
Latest managed failure, retained across worker replacement. -
getRestartCount
@JsProperty double getRestartCount()Number of explicit or automatic worker restarts. -
getStatus
Current managed lifecycle state. -
model
Adapt this handle to the standard model synchronization contract.- Parameters:
channel- Value supplied for the channel parameter.- Returns:
- Method result.
-
onError
Subscribe to runtime, message, decoding, and request failures.- Parameters:
listener- Value supplied for the listener parameter.- Returns:
- Method result.
-
onMessage
Subscribe to decoded worker messages.- Parameters:
listener- Value supplied for the listener parameter.- Returns:
- Method result.
-
post
Send a typed message and optional transferable ownership list.- Parameters:
message- Value supplied for the message parameter.transfer- Value supplied for the transfer parameter.
-
request
Send a correlated request using the AngularTS worker envelope.- Parameters:
message- Value supplied for the message parameter.options- Value supplied for the options parameter.- Returns:
- Method result.
-
restart
void restart()Replace the native worker unless this connection was terminated. -
setError
Latest managed failure, retained across worker replacement. -
setRestartCount
@JsProperty void setRestartCount(double restartCount) Number of explicit or automatic worker restarts. -
setStatus
Current managed lifecycle state. -
terminate
void terminate()Permanently terminate this managed connection.
-