Interface DurableObjectNamespace.DurableObjectStub

All Superinterfaces:
org.teavm.jso.JSObject
Enclosing interface:
DurableObjectNamespace

public static interface DurableObjectNamespace.DurableObjectStub extends org.teavm.jso.JSObject
A handle on one instance.

Every call here crosses to wherever the instance lives, so it blocks. An instance's own methods are reachable through rpc(String, TSObject...) when it extends Cloudflare's DurableObject base class.

Since:
1.0.0
  • Method Details

    • fetch

      default Response fetch(Request request)
      Sends a request to the instance.
      Parameters:
      request - the request
      Returns:
      the instance's response
    • fetch

      default Response fetch(String url)
      Sends a request to the instance by URL.
      Parameters:
      url - the URL, whose host is ignored
      Returns:
      the instance's response
    • rpc

      default TSObject rpc(String method, TSObject... args)
      Calls one of the instance's own methods.
      Parameters:
      method - the method name
      args - the arguments
      Returns:
      what the method returned
    • getId

      Returns this instance's id.
      Returns:
      this instance's id
    • send

      org.teavm.jso.core.JSPromise<Response> send(Request request)
    • send

      org.teavm.jso.core.JSPromise<Response> send(String url)