10dd59c039
This CL contains breaking changes for package:dtd and prepares both package:dart_service_protocol_shared and package:dtd for publish. This CL also fixes https://github.com/dart-lang/sdk/issues/60757 so that DTD-registered services are sent over the `Service` stream upon initial subscription like what is done for client-registered services. Change-Id: I619af816e64af01864c7ed9b98743c6691bf7e0b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429161 Reviewed-by: Ben Konyi <bkonyi@google.com> Commit-Queue: Kenzie Davisson <kenzieschmoll@google.com>
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.
- allows a client to subscribe/cancel to a stream with
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.
- handle method requests with
ClientManager, keeps track of clients connected to a service.addClientshould be called when a client connects to your service.removeClientshould be called when it disconnects.
Usage
To see an example of how dart_service_protocol_shared is used see: