Interface CommandStream
- All Known Implementing Classes:
PushStream
@ProviderType
public interface CommandStream
This interface defines a stream to which Command
s are pushed during the compilation of a HTL script by the SightlyCompiler
. 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.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addHandler
(CommandHandler handler) Registers a listeningCommandHandler
to the stream.Returns theList
of commands that were written into this stream.
-
Method Details
-
addHandler
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
Returns theList
of commands that were written into this stream.- Returns:
- the commands written into this stream
-