Skip to content

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

Closed
wants to merge 3 commits into from
Closed

feat: execute/subscribe AsyncIterable API #211

wants to merge 3 commits into from

Conversation

n1ru4l
Copy link
Collaborator

@n1ru4l n1ru4l commented May 24, 2021

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 and onExecuteDone handlers return an object with the properties onNext and onFinal 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

@changeset-bot
Copy link

changeset-bot bot commented May 24, 2021

⚠️ No Changeset found

Latest commit: 93cfa68

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@n1ru4l n1ru4l force-pushed the feat-context-per-subscription-event branch 4 times, most recently from ab73859 to b667b3f Compare May 24, 2021 19:03
…implementations this will actually ensure the finally block is always invoked.
Comment on lines +137 to +143
executeRaw: makeExecute(async (args: ExecutionArgs) => {
const proxy = initRequest();
return await proxy.execute({
...args,
contextValue: await proxy.contextFactory(args.contextValue),
});
}),
Copy link
Collaborator Author

@n1ru4l n1ru4l May 27, 2021

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?

Copy link
Member

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.

@n1ru4l n1ru4l marked this pull request as ready for review June 1, 2021 04:51
@n1ru4l n1ru4l changed the title poc: execute/subscribe AsyncIterable API feat: execute/subscribe AsyncIterable API Jun 1, 2021
@n1ru4l n1ru4l requested a review from dotansimha June 1, 2021 04:51
@n1ru4l n1ru4l closed this Jul 16, 2021
@n1ru4l n1ru4l deleted the feat-execute-subscribe-api branch July 16, 2021 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants