Class JSWorker

java.lang.Object
cn.nukkit.plugin.js.JSWorker
All Implemented Interfaces:
AutoCloseable

public final class JSWorker extends Object implements AutoCloseable
  • Constructor Details

    • JSWorker

      public JSWorker(org.graalvm.polyglot.Context sourceContext, ESMFileSystem fileSystem, String workerSourcePath)
  • Method Details

    • init

      public void init() throws IOException
      Throws:
      IOException
    • start

      public void start()
    • setSourceReceiveCallback

      public void setSourceReceiveCallback(org.graalvm.polyglot.Value value)
    • setWorkerReceiveCallback

      public void setWorkerReceiveCallback(org.graalvm.polyglot.Value value)
    • getSourceReceiveCallback

      public org.graalvm.polyglot.Value getSourceReceiveCallback()
    • getWorkerReceiveCallback

      public org.graalvm.polyglot.Value getWorkerReceiveCallback()
    • postMessage

      public org.graalvm.polyglot.Value postMessage(org.graalvm.polyglot.Value... arguments)
    • postMessageAsync

      public JSConcurrentManager.JPromise postMessageAsync(org.graalvm.polyglot.Value... arguments)
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception