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

Pipelines as generators #69

Closed
DaGutsche opened this issue Jul 21, 2022 · 1 comment
Closed

Pipelines as generators #69

DaGutsche opened this issue Jul 21, 2022 · 1 comment

Comments

@DaGutsche
Copy link

I have been working with factory.ts for quite some time and I am a big. But I recently had the issue where I needed to get multiple instances of a Pipeline. I use result of a pipeline as a representations of DBrecords where some entities have dependencies on others and I needed to create multiple of such, but I could not see that this is supported. So I made a generator function that creates a pipeline in each iteration and returns the result as a workaround.

It would be cool if it was a buildin feature to do something like const pipeline = Factory.Pipeline.Pipeline.start().addFac....; await pipeline.buildList(10) or something similar.

Any thoughts?

@willryan
Copy link
Owner

Hey @DaGutsche, sorry for the slow reply. I've just changed jobs, and I'm still waiting on approval to continue to fully own any work I do on this project. For the time being I won't be making changes myself, but I can approve other PRs.

Anyway, I think what you are saying makes sense. I haven't touched the pipelines in a bit, but I was wondering about changing the pipeline (or augmenting it), such that it can return an AsyncFactory at the end, instead of directly awaiting for the results. That would then allow pipelines to conform to the same ultimate generation API as factories. As noted above, I can't implement this just yet, but I'd be happy to approve a PR. If you do take up this change, I am thinking maybe add toFactory() on Pipeline. What do you think? Happy to discuss options here too.

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

2 participants