Interface Queue

All Superinterfaces:
org.teavm.jso.JSObject

public interface Queue extends org.teavm.jso.JSObject
A Queue producer. Declared with queue(), named QUEUE by default.

Sending is the producer half; Consumer is the other. A body is capped at 128 KB and has to be a structured-clone value, so a JavaScript function or a class instance cannot be sent.

Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    send(TSObject body)
    Sends one message.
    default void
    send(TSObject body, int delaySeconds)
    Sends one message after a delay.
    default void
    sendBatch(TSObject... bodies)
    Sends several messages in one call, which counts as one write rather than several.
    default void
    Sends one message as JSON.
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
     
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
    sendMessage(TSObject body, org.teavm.jso.JSObject options)
     
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
    sendMessages(org.teavm.jso.core.JSArray<TSObject> messages)
     

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • send

      default void send(TSObject body)
      Sends one message.
      Parameters:
      body - the body, at most 128 KB once serialised
    • sendJson

      default void sendJson(String json)
      Sends one message as JSON.
      Parameters:
      json - the body, serialised
    • send

      default void send(TSObject body, int delaySeconds)
      Sends one message after a delay.
      Parameters:
      body - the body
      delaySeconds - how long to hold it before delivery
    • sendBatch

      default void sendBatch(TSObject... bodies)
      Sends several messages in one call, which counts as one write rather than several.
      Parameters:
      bodies - the bodies
    • sendMessage

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> sendMessage(TSObject body)
    • sendMessage

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> sendMessage(TSObject body, org.teavm.jso.JSObject options)
    • sendMessages

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> sendMessages(org.teavm.jso.core.JSArray<TSObject> messages)