Search packages, repositories and app categories

Package detailsv1.0.0

rsocket

RSocket for Dart

AndroidiOSWebmacOSWindowsLinux
30-day downloads
86
Likes
19
Pub points
100

Install package

flutter pub add rsocket

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

RSocket for Dart is a lightweight, reactive networking protocol implementation that enables efficient, bidirectional communication between clients and servers. It supports streaming, request-response, request-stream, and fire-and-forget patterns over various transport layers. Built for low-latency, high-throughput scenarios, it's ideal for real-time applications requiring reliable data flow. The package integrates seamlessly with Dart’s async/await syntax and works across multiple platforms including mobile, web, and desktop. It follows the RSocket protocol specification, ensuring compatibility with other RSocket implementations.

Use cases

  • Real-time data streaming
  • Bidirectional communication
  • Low-latency microservices
  • Event-driven architectures
  • High-throughput messaging
  • Remote procedure calls

Key features

  • Reactive programming model
  • Supports multiple interaction models
  • Cross-platform compatibility
  • Lightweight and efficient
  • Built-in error handling
  • Integration with Dart async/await

Suitable for

  • Real-time apps
  • Microservices communication
  • IoT devices
  • Streaming APIs
  • High-performance backends

Considerations

  • Requires RSocket server support
  • Limited documentation compared to HTTP clients
  • Steeper learning curve for reactive concepts
  • Not suitable for simple REST-like requests
  • May require additional setup for authentication

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

RSocket Dart SDK

Examples

Client
import 'package:rsocket/rsocket_connector.dart';
import 'package:rsocket/payload.dart';

void main() async {
  var rsocket = await RSocketConnector.create().connect('tcp://127.0.0.1:42252');
  var result = await rsocket.requestResponse(Payload.fromText('text/plain', 'Ping'));
  print(result.getDataUtf8());
}
Server
import 'package:rsocket/rsocket_server.dart';
import 'package:rsocket/payload.dart';
import 'package:rsocket/rsocket.dart';

void main() async {
  const listenUrl = 'tcp://0.0.0.0:42252';
  var closeable = await RSocketServer.create(requestResponseAcceptor((payload) {
    return Future.value(Payload.fromText('text/plain', 'Pong'));
  })).bind(listenUrl);
  print('RSocket Server started on ${listenUrl}');
}

RSocket Service Proxy & Routing

Please refer https://github.com/rsocket/rsocket-dart/tree/master/lib/route

RSocket

  • Operations
    • [x] REQUEST_FNF
    • [x] REQUEST_RESPONSE
    • [x] REQUEST_STREAM
    • [ ] REQUEST_CHANNEL
    • [x] METADATA_PUSH
  • More Operations
    • [x] Error
    • [ ] Cancel
    • [x] Keepalive
  • QoS
    • [ ] RequestN
    • [ ] Lease
  • Transport
    • [x] TCP
    • [x] Websocket
  • High Level APIs
    • [x] Client
    • [x] Server
  • Misc
    • [x] RxDart

References

  • RSocket: https://rsocket.io
  • Dart: https://dart.dev/

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package

No data available yet.