feat(transform funcs): stepped transform functions, protected execution #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
after a chat with @dustmop we came to the conclusion that we need more control over what kind of things the user can do and when they can do them in the context of a transformation. The first example we could think of is preventing a transform script that lists a peers datasets & posting them to a random server with the http module.
To solve this we're restructuring the execution of transform steps, based on the
init, main
pattern from go/c-type programs, or thesetup, draw
pattern from various video game engines. In all cases users can optionally declare as a set of functions with standard names & signatures that the user can declare, and qri will call them. The stipulation is the output of each of these functions can only be data. Each of these opt-in "steps" execute in a predeclared order, with the result of the previous step being the input to the next step. The input to the initial step is any provided dataset data.Current steps:
download, transform
What I'm excited about here is we can later add steps like
map
andreduce
, and execute those in parallel environments.