dart_service_protocol_shared

0.0.3

A package that implements service extensions and stream managers.

Download archive

Readme

An unlisted package for sharing code for service events and stream management between Dart SDK internal services.

The Dart Developer Service and Dart Tooling Daemon are the main consumers of this package.

Expected SLO: this package is maintained for our own tooling; we may not be able to respond to all issues and may only address the ones that we ourselves encounter.

Details

This package helps handle some of the plumbing required to setup client communication for a service. The main behavior that it helps with is:

  • StreamManager
    • allows a client to subscribe/cancel to a stream with streamListen/streamCancel.
    • allows a client to post a message to a stream with postEvent.
  • Client, an interface that ensures the client is equipped to:
    • handle method requests with sendRequest.
    • handle receiving a message sent to a stream with streamNotify.
  • ClientManager, keeps track of clients connected to a service.
    • addClient should be called when a client connects to your service.
    • removeClient should be called when it disconnects.

Usage

To see an example of how dart_service_protocol_shared is used see:

Changelog

0.0.3

  • Update sdk constraint to '^3.5.0'
  • Added ClientServiceInfo.fromJson and ClientServiceInfo.toJson methods.
  • Added ClientServiceMethodInfo.fromJson and ClientServiceMethodInfo.toJson methods.

0.0.2

  • Fixed an issue with streamNotify data type being too specific.

0.0.1

  • Initial version.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add dart_service_protocol_shared
pubspec.yaml
name: dart_service_protocol_shared
description: A package that implements service extensions and stream managers.

version: 0.0.3
repository: https://github.com/dart-lang/sdk/tree/main/pkg/dart_service_protocol_shared

environment:
  sdk: ^3.5.0

resolution: workspace

dependencies:
  meta: ^1.11.0

dev_dependencies:
  lints: any
  test: any

Version history

VersionPublishedArchiveSHA-256
0.0.1On demandDownload88f117b5…31d2a8
0.0.2On demandDownloada1f10ca3…7f1cd7
0.0.3Cached · Upstream SHA-256 matchedDownload1737875c…c7a76d

Dependencies

meta "^1.11.0"