Interface CommandStream
-
@ProviderType public interface CommandStream
This interface defines a stream to which
Commands are pushed during the compilation of a HTL script by theSightlyCompiler. Depending on how a consumer wants to use the stream there are several options:- if the stream needs to be consumed immediately then a
CommandHandlercan be attached to the stream; the stream, in turn, will notify the handler for every command that has been pushed; - if the stream can be consumed after the actual compilation there's no need to attach a
CommandHandler, as theCommands that were written to the stream can be replayed in the exact order in which they have been pushed.
- if the stream needs to be consumed immediately then a
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddHandler(CommandHandler handler)Registers a listeningCommandHandlerto the stream.java.util.List<Command>getCommands()Returns theListof commands that were written into this stream.
-
-
-
Method Detail
-
addHandler
void addHandler(CommandHandler handler)
Registers a listeningCommandHandlerto the stream. TheCommandHandlerwill be notified for every newCommandpushed to this stream.- Parameters:
handler- the handler to attach to this stream
-
getCommands
java.util.List<Command> getCommands()
Returns theListof commands that were written into this stream.- Returns:
- the commands written into this stream
-
-