Pakete, Repositories und App-Kategorien suchen

Paketdetailsv0.21.0

centrifuge

Dart-Client zur Kommunikation mit Centrifuge und Centrifugo über WebSocket von Flutter und VM aus

AndroidiOSWebmacOSWindowsLinux
30-Tage-Downloads
76.500
Likes
49
Pub-Punkte
140

Paket installieren

flutter pub add centrifuge

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Centrifuge ist ein Dart-Client für die Echtzeitkommunikation mit Centrifuge- und Centrifugo-Servern über WebSockets. Er ermöglicht es Flutter- und VM-Anwendungen, sich auf Kanäle zu abonnieren, Live-Updates zu empfangen und Nachrichten in Echtzeit zu veröffentlichen. Für geringe Latenzzeiten konzipiert, unterstützt er Verbindungsmanagement, Wiederherstellungslogik und Nachrichtenbroadcasting über mehrere Plattformen hinweg. Ideal für die Entwicklung von Chat-Apps, Live-Dashboards und kooperativen Tools, die eine sofortige Daten-Synchronisation erfordern.

Anwendungsfälle

  • Echtzeit-Chats-Anwendungen
  • Live-Dashboard-Updates
  • Kooperationseditoren
  • Push-Benachrichtigungen
  • Synchronisation von Mehrspieler-Spielen

Hauptmerkmale

  • Echtzeitkommunikation basierend auf WebSocket
  • Automatische Wiederherstellung der Verbindung
  • Kanalabonnement und -veröffentlichung
  • Plattformübergreifende Unterstützung
  • Leicht und effizient
  • Sichere Token-Authentifizierung

Geeignet für

  • Flutter-Mobile- und Web-Apps
  • Serverseitige Dart-Dienste
  • Echtzeit-Datenströmung
  • Hochfrequenz-Ereignisverarbeitung

Hinweise

  • Benötigt einen laufenden Centrifuge- oder Centrifugo-Server
  • Erforderliche Authentifizierungseinstellungen
  • Kann Konfiguration von Netzwerkberechtigungen auf Mobilgeräten erfordern
  • Abhängig von stabiler WebSocket-Konnektivität

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

Websocket client for Centrifugo server and Centrifuge library.

Since there is no v1 release yet, patch version updates only contain backwards compatible changes, minor version updates can have backwards incompatible API changes.

Check out client SDK API specification to learn how this SDK behaves. It's recommended to read that before starting to work with this SDK as the spec covers common SDK behavior - describes client and subscription state transitions, main options and methods. Also check out examples folder.

The features implemented by this SDK can be found in SDK feature matrix.

Note that custom WebSocket connection Upgrade headers are sent natively on platforms that support dart:io and in web context headers are sent using Centrifugo v6 Headers Emulation feature.

The latest centrifuge-dart is compatible with Centrifugo server v6, v5 and v4 and Centrifuge >= 0.25.0. For Centrifugo v2, Centrifugo v3 and Centrifuge < 0.25.0 you should use centrifuge-dart v0.8.0.

Examples

  • example\flutter_app simple chat application
  • example\chat_app one more chat example
  • example\console simple console application

Usage in background

When a mobile application goes to the background there are OS-specific limitations for established persistent connections - which can be silently closed shortly. Thus in most cases you need to disconnect from a server when app moves to the background and connect again when app goes to the foreground.

Alternative SDK

See also PlugFox/spinify for an alternative Dart (Flutter) real-time client SDK implementation.

Run tests locally

Start test Centrifugo server:

docker compose up

Then run tests:

dart run test --reporter expanded

Instructions for maintainers/contributors

How to update protobuf definitions
  1. Install protoc compiler
  2. Install protoc_plugin https://pub.dev/packages/protoc_plugin (dart pub global activate protoc_plugin)
  3. cd lib/src/proto and run protoc --dart_out=. -I . client.proto
  4. cd to root and run dartfmt -w lib/ test/ (install dartfmt with dart pub global activate dart_style)
How to release
  1. Update CHANGELOG.md, bump version in pubspec.yaml, push, create new tag
  2. [ONLY IF THERE ARE ISSUES WITH CI PUBLISH] dart pub publish

Author

German Saprykin, saprykin.h@gmail.com

Kategorien

Abhängigkeiten

Abhängigkeiten 4 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden

Ranglisten