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

feat(relay): irn_batchRequest method #222

Open
wants to merge 1 commit into
base: main-lfs-DO-NOT-USE
Choose a base branch
from

Conversation

heilhead
Copy link

This adds the irn_batchRequest method which would allow to combine multiple requests into a single one, specifying execution mode (either concurrent or sequential). See this slack conversation for context.

Copy link

vercel bot commented Apr 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
walletconnect-specs ✅ Ready (Inspect) Visit Preview Apr 10, 2024 0:42am

"method": "irn_batchRequest",
"params" : {
"batch": Request[],
"mode": "sequence" | "concurrent"
Copy link
Member

Choose a reason for hiding this comment

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

I thought we had a use-case where we need both sequence and concurrent at the same time.
Like:

  • execute 3 requests concurrently
  • afterwards execute another request

Isn't it the case?

Copy link
Author

Choose a reason for hiding this comment

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

Correct. So with the suggested implementation you'd combine requests like this:

{
  "method": "irn_batchRequest",
  "params": {
    "mode": "sequence",
    "batch": [
      // First execute a batch of requests concurrently.
      {
        "method": "irn_batchRequest",
        "params": {
          "mode": "concurrent",
          "batch": [
            // Concurrent requests, e.g. subscriptions.
          ]
        },
        ...
      },

      // Then another request once the first batch is processed.
      {
        "method": "irn_publish",
        ...
      },
    ]
  },
  ...
}

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

Successfully merging this pull request may close these issues.

2 participants