You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #27 is finished, we should follow up with a feature to support connecting node streams within a diagram.
There are two aspects to consider:
1. Sending a stream output out of the workflow
We can have diagram-based workflows always provide a DiagramStream as their stream type. It might look something like this:
#[derive(Debug,Clone,Stream)]pubstructDiagramStream{/// The type name as given by std::any::type_namepubtype_name:&'staticstr,/// The actual value streamed inpubvalue: serde_json::Value,}
then we can implement Splittable for this struct so that users of the workflow can connect specific stream output types into the nodes that are able to receive them.
Then we can introduce a built-in stream_out target for the ops schema that converts any incoming type into a DiagramStream instance and streams it out of the workflow. An example might look like this:
This means users would not be able to use "stream_out" as an operation ID, similar to "start" and "terminate".
2. Connecting a stream output of one node into the input slot of another node within the same diagram
We can introduce a "stream_to" field for the "node" operation that provides a dictionary of stream output type names along with the target name for where it should be sent. The schema might look something like this:
We may need to add a method to the Stream trait to help us convert the Streams generic argument into a dictionary that we can use to match DynOutputs to DynInputSlots.
The text was updated successfully, but these errors were encountered:
After #27 is finished, we should follow up with a feature to support connecting node streams within a diagram.
There are two aspects to consider:
1. Sending a stream output out of the workflow
We can have diagram-based workflows always provide a
DiagramStream
as their stream type. It might look something like this:then we can implement
Splittable
for this struct so that users of the workflow can connect specific stream output types into the nodes that are able to receive them.Then we can introduce a built-in
stream_out
target for theops
schema that converts any incoming type into aDiagramStream
instance and streams it out of the workflow. An example might look like this:This means users would not be able to use
"stream_out"
as an operation ID, similar to"start"
and"terminate"
.2. Connecting a stream output of one node into the input slot of another node within the same diagram
We can introduce a
"stream_to"
field for the"node"
operation that provides a dictionary of stream output type names along with the target name for where it should be sent. The schema might look something like this:We may need to add a method to the
Stream
trait to help us convert theStreams
generic argument into a dictionary that we can use to matchDynOutput
s toDynInputSlot
s.The text was updated successfully, but these errors were encountered: