Package net.voidnote
Class StreamHandle
java.lang.Object
net.voidnote.StreamHandle
A live Void Stream. Write encrypted messages and
close() to self-destruct.
Obtained from VoidNote.createStream(StreamOptions).
StreamHandle stream = VoidNote.createStream(StreamOptions.of("vn_..."));
System.out.println(stream.url); // share this before writing
stream.write("Deployment starting...");
stream.write("Build complete — 47/47 passed");
stream.close();
-
Field Summary
Fields -
Method Summary
-
Field Details
-
url
Shareable URL. Share this with viewers before writing messages. -
expiresAt
ISO 8601 expiry timestamp.
-
-
Method Details
-
write
Encryptscontentclient-side and pushes it to the stream. The server never sees the plaintext.- Throws:
VoidNoteException
-
close
Closes the stream. Viewers receive aclosedevent and all content self-destructs.- Throws:
VoidNoteException
-
watch
Subscribes to this stream, callingonMessagefor each decrypted event. Blocks until the stream is closed or an unrecoverable error occurs. Automatically reconnects on connection drop using SSELast-Event-ID.To run non-blocking, wrap in a thread:
Thread.ofVirtual().start(() -> stream.watch(msg -> System.out.println(msg)));- Throws:
VoidNoteException
-