Package dev.gmitch215.bytebox.binding
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 TypeMethodDescriptiondefault voidSends one message.default voidSends one message after a delay.default voidSends several messages in one call, which counts as one write rather than several.default voidSends one message as JSON.org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> sendMessage(TSObject body) 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
Sends one message.- Parameters:
body- the body, at most 128 KB once serialised
-
sendJson
Sends one message as JSON.- Parameters:
json- the body, serialised
-
send
Sends one message after a delay.- Parameters:
body- the bodydelaySeconds- how long to hold it before delivery
-
sendBatch
Sends several messages in one call, which counts as one write rather than several.- Parameters:
bodies- the bodies
-
sendMessage
-
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)
-