パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.4.0

eventsource

Server-Sent Events のクライアントおよびサーバー実装。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
595
いいね数
30
Pub ポイント
120

パッケージをインストール

flutter pub add eventsource

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

サーバーからクライアントへのリアルタイムかつ一方向の通信を可能にする、サーバーセントイベント(SSE)のクライアントおよびサーバー実装を提供するDartパッケージです。HTTP経由でのイベントストリーミングをサポートしており、ライブアップデート、通知、データフィードに最適です。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxなど、すべての主要プラットフォームで互換性があります。SSE標準に準拠し、イベントID、再試行間隔、カスタムイベントタイプのサポートも可能です。軽量な実装であり、FlutterおよびDartアプリケーションへのスムーズな統合が可能です。

用途

  • ライブ通知
  • リアルタイムデータストリーミング
  • サーバーサイドイベントブロードキャスト
  • Webアプリケーションにおけるステータスの更新
  • インタラクティブダッシュボード
  • ログストリーミング

主な機能

  • 完全なSSEプロトコルサポート
  • クロスプラットフォーム互換性
  • イベントIDと再試行処理
  • カスタムイベントタイプのサポート
  • 軽量で効率的
  • Flutterとの簡単な統合

適している対象

  • リアルタイムアプリ機能
  • プッシュ機能を必要とするバックエンドサービス
  • 低遅延更新を必要とするアプリ
  • ライブコンテンツを搭載したウェブおよびモバイルアプリ
  • Dart/Flutter を使ってフルスタックアプリを開発する開発者

注意事項

  • 双方向通信には適していません
  • 互換性のあるサーバー実装が必要です
  • サーバーからクライアントへのストリーミングに限定
  • 認証のための追加設定が必要になる場合があります
  • 高頻度・低遅延の更新に最適

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

eventsource

A library for using EventSource or Server-Sent Events (SSE). Both client and server functionality is provided.

This library implements the interface as described here.

Client usage

For more advanced usage, see the example/ directory. Creating a new EventSource client is as easy as a single call. The http package is used under the hood, so wherever this package works, this library will also work. Browser usage is slightly different.

EventSource eventSource = await EventSource.connect("http://example.com/events");
// in browsers, you need to pass a http.BrowserClient:
EventSource eventSource = await EventSource.connect("http://example.com/events", 
    client: new http.BrowserClient());

Server usage

We recommend using shelf_eventsource for serving Server-Sent Events. This library provides an EventSourcePublisher that manages subscriptions, channels, encoding. We refer to documentation in the shelf_eventsource package for more information.

This library also includes a server provider for dart:io's HttpServer in io_server.dart. However, it has some issues with data flushing that are yet to be resolved, so we recommend using shelf instead.

Licensing

This project is available under the MIT license, as can be found in the LICENSE file.

カテゴリー

依存関係

依存関係一覧 5 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。