Class NaruStreamInteraction

java.lang.Object
net.thevpc.naru.impl.interaction.NaruStreamInteraction
All Implemented Interfaces:
NaruInteraction

public class NaruStreamInteraction extends Object implements NaruInteraction
The headless implementation: no terminal, no thread, output forwarded to a listener.

This is the one a server embeds. A web front end hands each session a listener that pushes NaruOutput onto an SSE stream or a websocket, and answers NaruInputRequests whenever the user submits a line — possibly from a different process, minutes later.

Nothing is dropped on the floor

An input request is published to an NaruStreamInteraction.InputListener and then held until it is delivered or cancelled, because there is no reader thread to pick it up. That is the whole point: the host owns the lifecycle, and the core waits. A host that never answers leaves the task blocked, which is the honest outcome and is preferable to inventing a default answer.