Skip to content

Optimize SharedWorker with sequential task queue to reduce parallel connection overhead #2009

@AMIRKHANEF

Description

@AMIRKHANEF

Summary

Currently, the SharedWorker processes all incoming requests in parallel. This leads to high connection overhead and degraded performance.

Problem

Because each message triggers network requests independently, multiple WebSocket or RPC connections may open at once, overloading both the client and remote nodes.

Proposed Solution

Implement a task queue within the SharedWorker so that incoming requests are:

  1. Added to a queue.
  2. Processed sequentially (or optionally with limited concurrency).
  3. Automatically trigger the next task once the current one completes.

Benefits

  • Prevents connection flooding.
  • Reduces RPC load and improves overall performance.
  • Keeps compatibility with existing message handling logic.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions