-
Notifications
You must be signed in to change notification settings - Fork 131
feat: execute/subscribe AsyncIterable API #211
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
feat: execute/subscribe AsyncIterable API #211
Conversation
|
ab73859
to
b667b3f
Compare
…implementations this will actually ensure the finally block is always invoked.
executeRaw: makeExecute(async (args: ExecutionArgs) => { | ||
const proxy = initRequest(); | ||
return await proxy.execute({ | ||
...args, | ||
contextValue: await proxy.contextFactory(args.contextValue), | ||
}); | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dotansimha At the moment the testkit is pretty helix tailored. I assume this is in order to be more integration test-like, and closer to how envelop is used with actual network layers?
I added this method here for now, but maybe we should in that case just construct all the stuff in place within the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove helix for testing, I initially used it because I wanted to test envelop with a request, but it's no longer needed.
This is a POC for hooking into the phases of the async iterable returned from execute or subscribe (similar to the approach described in #182).It is currently based upon
#187 and#183. It should be rebased once it is merged into main.~~The idea is to let the
onSubscribeResult
andonExecuteDone
handlers return an object with the propertiesonNext
andonFinal
which will be invoked in case we have an async iterable.Currently, tests are missing, as I first want to gather feedback on whether this could be the way to go.The relevant commit is aea90c4