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

Use RpcResponseTransformer in PubSubSubscriptionPlan #3404

Merged

Conversation

lorisleiva
Copy link
Contributor

@lorisleiva lorisleiva commented Oct 21, 2024

This PR refactors the definition of a Response Transformer in the RPC Subscriptions architecture from <T>(response: unknown, notificationName: string) => T; to RpcResponseTransformer.

That way, both the RPC and RPC Subscriptions architectures use the same interfaces for transforming requests and responses which means we can refactoring helper method like getDefaultResponseTransformerForSolanaRpcSubscriptions in a more composable way (using the pipe function like we did with default RPC Response Transformer).

Note: A changeset for this PR is included in #3407.

Copy link

changeset-bot bot commented Oct 21, 2024

⚠️ No Changeset found

Latest commit: a5545b4

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.

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

@lorisleiva lorisleiva force-pushed the loris/use-rpc-request-in-pub-sub-executor branch from 24fbc91 to ba341d8 Compare October 21, 2024 11:20
@lorisleiva lorisleiva force-pushed the loris/use-rpc-response-transformer-in-pub-sub-executor branch from e3e426b to fb9b2ed Compare October 21, 2024 11:20
@lorisleiva lorisleiva force-pushed the loris/use-rpc-request-in-pub-sub-executor branch from ba341d8 to 2dcffdb Compare October 21, 2024 11:36
@lorisleiva lorisleiva force-pushed the loris/use-rpc-response-transformer-in-pub-sub-executor branch from fb9b2ed to 24a64f5 Compare October 21, 2024 11:36
@lorisleiva lorisleiva force-pushed the loris/use-rpc-request-in-pub-sub-executor branch from 2dcffdb to b640c71 Compare October 21, 2024 11:45
@lorisleiva lorisleiva force-pushed the loris/use-rpc-response-transformer-in-pub-sub-executor branch from 24a64f5 to 58f62b4 Compare October 21, 2024 11:46
@lorisleiva lorisleiva marked this pull request as ready for review October 22, 2024 08:44
Copy link
Contributor

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added via Giphy

@@ -14,7 +14,7 @@ import { RpcSubscriptionsChannel } from './rpc-subscriptions-channel';

type Config<TNotification> = Readonly<{
channel: RpcSubscriptionsChannel<unknown, RpcNotification<TNotification> | RpcResponseData<RpcSubscriptionId>>;
responseTransformer?: <T>(response: unknown, notificationName: string) => T;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added via Giphy

Copy link
Collaborator

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added via Giphy

Copy link
Contributor Author

lorisleiva commented Oct 23, 2024

Merge activity

  • Oct 23, 4:43 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 23, 4:56 AM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 23, 4:57 AM EDT: A user merged this pull request with Graphite.

@lorisleiva lorisleiva changed the base branch from loris/use-rpc-request-in-pub-sub-executor to graphite-base/3404 October 23, 2024 08:52
@lorisleiva lorisleiva changed the base branch from graphite-base/3404 to master October 23, 2024 08:54
@lorisleiva lorisleiva force-pushed the loris/use-rpc-response-transformer-in-pub-sub-executor branch from 58f62b4 to a5545b4 Compare October 23, 2024 08:55
@lorisleiva lorisleiva merged commit f127ee2 into master Oct 23, 2024
5 checks passed
@lorisleiva lorisleiva deleted the loris/use-rpc-response-transformer-in-pub-sub-executor branch October 23, 2024 08:57
Copy link
Contributor

github-actions bot commented Nov 7, 2024

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants