Refactor ChannelStrategy/OperatorContext
Max-Meldrum opened this issue · 0 comments
Max-Meldrum commented
The current implementation passes along a reference of ComponentDefinition
across multiple functions just so that a ChannelStrategy
can use it for kompacts tell_serialised
function.
Refactor ChannelStrategy
to return an iterator of (Channel, ArconMessage) that can be dispatched from the Node/SourceNode itself. This way we also can handle potential buffer errors easier too.
The above change also relates to operators as we also pass a ComponentDefinition
reference into the OperatorContext
.
Rather than outputting events through ctx.output(event)
, make handle_element/handle_timeout
return an element iterator.
// inside Operator trait
type ElementIterator: IntoIterator<Item = ArconElement<Self::OUT>> + 'static;
This change is also required for it to be possible to create an operator chain (#246).