rpc_dart
7.2.0, released 7 days ago by rpc.nogipx.dev
Transport-agnostic RPC framework for Dart with streaming and zero-copy in-process transport.
What it does
Provides a pure Dart RPC framework that can run over any transport, including in-process, WebSocket, HTTP/1.1, and HTTP/2 with gRPC wire protocol. It supports unary, server, client, and bidirectional streaming, resilience features, and optional code generation for boilerplate.
AI-written summary of version 7.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Building cross-platform RPC services that need to run over multiple transports
- Implementing streaming RPC calls with flow control
- Requiring zero-copy in-process communication for performance
Skip it when
- You only need a simple HTTP client or REST wrapper
- Your project already uses a dedicated gRPC library and you don't need the extra abstraction
Strengths
- Zero-copy in-process transport for high performance
- Built-in streaming support with flow control
- Resilience features like retry, circuit breaker, rate limiting
- Pure Dart implementation with no native dependencies
Weaknesses
- Complex API for beginners
- Requires understanding of RPC concepts and transport setup
- No built-in UI or higher-level abstractions
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 0
Add rpc_dart to pubspec, import package:rpc_dart/rpc_dart.dart, no build_runner needed unless using rpc_dart_generator
import 'package:rpc_dart/rpc_dart.dart';
final (clientTransport, serverTransport) = RpcChannelTransport.memoryPair();
final responder = RpcResponderEndpoint(transport: serverTransport);
responder.registerServiceContract(CalculatorResponder());
responder.start();
final caller = RpcCallerEndpoint(transport: clientTransport);
final res = await CalculatorCaller(caller).sum(SumRequest([1, 2, 3]));
print(res.result);Alternatives
Packages that do the same job and could replace rpc_dart.
- grpc
Dart implementation of gRPC, a high performance universal RPC framework.
90Compare - angel3_websocket
WebSockets support and event broadcasting for the Angel3 framework.
77Compare - nostr
Pure-Dart Nostr protocol library supporting events, signing, encryption, and 35+ NIPs.
67Compare - json_api
Framework-agnostic implementations of JSON:API Client and Server.
50Compare