Interface CommandStream
-
@ProviderType public interface CommandStream
This interface defines a stream to which
Command
s 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
CommandHandler
can 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 theCommand
s 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 void
addHandler(CommandHandler handler)
Registers a listeningCommandHandler
to the stream.java.util.List<Command>
getCommands()
Returns theList
of commands that were written into this stream.
-
-
-
Method Detail
-
addHandler
void addHandler(CommandHandler handler)
Registers a listeningCommandHandler
to the stream. TheCommandHandler
will be notified for every newCommand
pushed to this stream.- Parameters:
handler
- the handler to attach to this stream
-
getCommands
java.util.List<Command> getCommands()
Returns theList
of commands that were written into this stream.- Returns:
- the commands written into this stream
-
-