-
- All Superinterfaces:
StreamletScope<O>
- All Known Subinterfaces:
GenericStreamlet<I,O>
- All Known Implementing Classes:
AbstractRecordStreamlet
,AbstractStreamlet
,DownlinkStreamlet
,RecordStreamlet
public interface Streamlet<I,O> extends StreamletScope<O>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
bindInput(String key, Outlet<? extends I> input)
Connects theInlet
of thisStreamlet
, identified by the givenkey
, to theinput
from which theInlet
should acquire its state.void
decohere()
Marks thisStreamlet
—and all of its outlets—as having inconsistent state.void
disconnectInputs()
Disconnects allInlet
s dominated by thisStreamlet
in the dataflow dependency graph.void
disconnectOutputs()
Disconnects allInlets
s dominated by thisStreamlet
in the dataflow graph.Inlet<I>
inlet(String key)
Returns theInlet
to thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchInlet
.Outlet<O>
outlet(String key)
Returns theOutlet
of thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchOutlet
.void
recohere(int version)
Updates the state of thisStreamlet
to make it consistent with the targetversion
.void
setStreamletContext(StreamletContext context)
Sets the environment in which thisStreamlet
operates.void
setStreamletScope(StreamletScope<? extends O> scope)
Sets the lexically scoped parent of thisStreamlet
.StreamletContext
streamletContext()
Returns the environment in which thisStreamlet
operates.StreamletScope<? extends O>
streamletScope()
Returns the lexically scoped parent of thisStreamlet
.void
unbindInput(String key)
Disconnects theInlet
of thisStreamlet
, identified by the givenkey
, from itsinput
Outlet
, if connected.
-
-
-
Method Detail
-
streamletScope
StreamletScope<? extends O> streamletScope()
Returns the lexically scoped parent of thisStreamlet
. Returnsnull
if thisStreamlet
has no lexical parent.- Specified by:
streamletScope
in interfaceStreamletScope<I>
-
setStreamletScope
void setStreamletScope(StreamletScope<? extends O> scope)
Sets the lexically scoped parent of thisStreamlet
.
-
streamletContext
StreamletContext streamletContext()
Returns the environment in which thisStreamlet
operates.- Specified by:
streamletContext
in interfaceStreamletScope<I>
-
setStreamletContext
void setStreamletContext(StreamletContext context)
Sets the environment in which thisStreamlet
operates.
-
inlet
Inlet<I> inlet(String key)
Returns theInlet
to thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchInlet
.
-
bindInput
void bindInput(String key, Outlet<? extends I> input)
Connects theInlet
of thisStreamlet
, identified by the givenkey
, to theinput
from which theInlet
should acquire its state. Delegates toInlet.bindInput(Outlet)
on the identifiedInlet
.- Throws:
IllegalArgumentException
- if thisStreamlet
has noInlet
with the givenkey
.
-
unbindInput
void unbindInput(String key)
Disconnects theInlet
of thisStreamlet
, identified by the givenkey
, from itsinput
Outlet
, if connected. Delegates toInlet.unbindInput()
on the identifiedInlet
.- Throws:
IllegalArgumentException
- if thisStreamlet
has noInlet
with the givenkey
.
-
outlet
Outlet<O> outlet(String key)
Returns theOutlet
of thisStreamlet
identified by the givenkey
; returnsnull
if thisStreamlet
has no suchOutlet
.- Specified by:
outlet
in interfaceStreamletScope<I>
-
disconnectInputs
void disconnectInputs()
Disconnects allInlet
s dominated by thisStreamlet
in the dataflow dependency graph. Used to recursively clean up chains of combinators terminating at thisStreamlet
.
-
disconnectOutputs
void disconnectOutputs()
Disconnects allInlets
s dominated by thisStreamlet
in the dataflow graph. Used to recursively clean up chains of combinators originating from thisStreamlet
.
-
decohere
void decohere()
Marks thisStreamlet
—and all of its outlets—as having inconsistent state. Decohering aStreamlet
will recursively decohere all streamlets that transitively depend on the state of thisStreamlet
. Decohering aStreamlet
does not cause its state to be recomputed. A subsequentrecohere(int)
call will eventually make the state of theStreamlet
coherent again.
-
recohere
void recohere(int version)
Updates the state of thisStreamlet
to make it consistent with the targetversion
. TheStreamlet
only needs to update if its currentversion
differs from the targetversion
. To update its state, theStreamlet
first invokesInlet.recohereOutput(int)
on each of its inlets, to ensure that its input states are coherent. It then recomputes its own state in an implementation defined manner. Finally, it invokesOutlet.recohereInput(int)
on its outlets, causing all transitively dependent streamlets to make their own states coherent again.
-
-