Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Task API #54

Open
sroussey opened this issue Feb 26, 2025 · 6 comments
Open

Rework Task API #54

sroussey opened this issue Feb 26, 2025 · 6 comments
Assignees

Comments

@sroussey
Copy link
Owner

sroussey commented Feb 26, 2025

Rework creating a task API by putting input first, config (optional) second

In the DelayTask, the delay is not going to typically be an input from another task... it is more like a config. The ngraph node UI should treat it that way, but present it like an input.

So... is that a "config input"? Need to think about this for a beat.

Task Input/Output and DataFlow to use "all" input/output, not need to pick a specific one. This would not include the "config input"

@sroussey sroussey changed the title Rework creating a task API Rework Task API Feb 26, 2025
@sroussey
Copy link
Owner Author

Could be a dataflow for "*" as input source.

@sroussey
Copy link
Owner Author

sroussey commented Feb 26, 2025

const workflow = new Workflow()
  .add(new FetchData())
  .map([new TransformData(), new BackupData()]) // Runs both in parallel
  .reduce(new SaveToDatabase()); // Merges both outputs

await workflow.run();

If I did this, could get away from always using ArrayTask, and only using it for reduce().

reduce strategies:

  • array: assumes inputs and outputs are the same, and will turn them into arrays
  • object_by_id: create an object where the id is the key
  • object_by_type: create an object where the key is the task type (create arrays if duplicate task types or error?)
  • entries_by_id: return an array [id, results],[id2, results]
  • entries_by_type

@sroussey sroussey self-assigned this Feb 27, 2025
@sroussey
Copy link
Owner Author

rename run to execute and then runFull to run.

add utility fn so a task can have its own outputrepo and if set, the runner should skip

rework how outputrepo is given to runner and passed along

@sroussey
Copy link
Owner Author

outputrepo should have option for compression

@sroussey
Copy link
Owner Author

DataFlow references to values should be "ports". It goes better with the the UI for D&D nodes. Also, we can have ports "*" for everything, and [error] for error port (though right now processing stops on an error, but maybe not in the future

@sroussey
Copy link
Owner Author

DataFlow should have a status so we know if it is streaming and not completed yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant