Skip to content

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.

@vercel
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.

3 participants