Replies: 1 comment 1 reply
-
First of all, thank you for your work, I really like it. I want to add smth to this (T)RFC
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Abstract
Our current pipeline solution doesn't fit many use cases. We aim to support as many cases as possible with minimal effort.
Current Pipeline Features:
Missing Functionality:
Additionally, every component should be composable—meaning you can nest groups within other groups.
Solution
First, we should update our
PipelineAPI
and introduce a generic class that the pipeline can append to. All components will be added using a single method:.then()
.Example usage:
This API allows us to mimic a bind-like operator from functional programming languages in Python. Here's the same pipeline using the bind (
>>
) approach:With this syntax, pipelines can be built like so:
Also, this approach allows us to make it easier to extens the whole pipeline engine within user's codebases.
Interface
In order to achieve desired API, we need to be able to serialize every component of the pipeline into a single intermediate representation.
Here’s the current generic representation of a pipeline step:
As you can see, this structure doesn't support groups and other nested features well. With nested pipelines or groups, we might want to track each step individually—or at least be aware of each nested step—at the time when users calls
kiq
to monitor progress effectively.Other ideas:
We might want to introduce unique byte sequence that will mean that result of previous function should be used. It will allow us to make much cleaner code.
As an example:
The
STEP_RESULT
should be a unique byte sequence that is very unlikely to be met.This will allow us to improve static type checking, because now it will be validating all the arguments of tasks during creation of pipeline, because of
ParamSpec
. Of course we need to verify that this idea can be implemented as proposed.Beta Was this translation helpful? Give feedback.
All reactions