How jack-works/async-call-rpc works
Main Components
a. Core RPC Layer:
• JSON RPC Protocol Handler
• Request/Response Manager
• Error Handler
• Batch & Notification Manager
b. Communication Layer:
• CallbackBasedChannel Interface
• EventBasedChannel Interface
• Built-in Channel Implementations (WebSocket, BroadcastChannel, Worker)
c. Encoding/Serialization Layer:
• An "Encoder Framework" showing:
• IsomorphicEncoder Interface
• IsomorphicEncoderFull Interface
• Default JSON Encoder
• Custom Encoder Support
d. Generator Support:
• An "AsyncGenerator Handler" component showing:
• Iterator Protocol Implementation
• Internal RPC Methods
• Generator State Management
Component Relationships
Client Application → AsyncCall Core → Channel Layer → Network/IPC
Network/IPC → Channel Layer → AsyncCall Core → Server Implementation
Detailed Elements
Specific technical details:
Core Features:
• JSON RPC 2.0 Protocol
• Request/Response Handling
• Error Mapping
• Batch Processing
• Notifications
• Type Safety (TypeScript)
Channel Types:
• WebSocket (Node/Web/Deno)
• BroadcastChannel
• Worker
• Custom Channel Support
Encoding Options:
• JSON
• Custom Encoders
• Serialization Controls
Implementation Notes
Annotations for:
• Zero dependencies
• ES2018+ Support
• Cross-platform compatibility
• TypeScript integration
• Custom error handling
• Memory leak warning for generators
Data Flow Markers
Specific data transformations:
Raw Data → Encoder → Channel → Network → Channel → Decoder → Typed Data