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.
  • Method Details

    • getError

      @JsProperty WorkerError getError()
      Latest managed failure, retained across worker replacement.
    • getRestartCount

      @JsProperty double getRestartCount()
      Number of explicit or automatic worker restarts.
    • getStatus

      @JsProperty String getStatus()
      Current managed lifecycle state.
    • model

      <T> ModelSyncTarget<T> model(String channel)
      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

      void post(TSend message, elemental2.core.JsArray<Object> transfer)
      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

      elemental2.promise.Promise<TReceive> request(TSend message, WorkerRequestOptions options)
      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

      @JsProperty void setError(WorkerError error)
      Latest managed failure, retained across worker replacement.
    • setRestartCount

      @JsProperty void setRestartCount(double restartCount)
      Number of explicit or automatic worker restarts.
    • setStatus

      @JsProperty void setStatus(String status)
      Current managed lifecycle state.
    • terminate

      void terminate()
      Permanently terminate this managed connection.