From d2eb602b2d26d9bd0a24f752fdeb04c8f9223d2a Mon Sep 17 00:00:00 2001 From: thomashii Date: Tue, 18 May 2021 21:55:30 +0800 Subject: [PATCH] Updated pub_sub --- packages/pub_sub/CHANGELOG.md | 2 ++ packages/pub_sub/README.md | 2 +- packages/pub_sub/example/main.dart | 2 +- packages/pub_sub/lib/src/json_rpc/client.dart | 6 ++++-- packages/pub_sub/pubspec.yaml | 2 +- packages/pub_sub/test/json_rpc_2_test.dart | 8 ++------ 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/pub_sub/CHANGELOG.md b/packages/pub_sub/CHANGELOG.md index b8a599d0..74d0123b 100644 --- a/packages/pub_sub/CHANGELOG.md +++ b/packages/pub_sub/CHANGELOG.md @@ -1,3 +1,5 @@ +# 3.0.1 +* Resolved static analysis warnings # 3.0.0 * Migrated to work with Dart SDK 2.12.x NNBD diff --git a/packages/pub_sub/README.md b/packages/pub_sub/README.md index 08181fba..b4b18d9f 100644 --- a/packages/pub_sub/README.md +++ b/packages/pub_sub/README.md @@ -1,5 +1,5 @@ # angel3_pub_sub -[![version](https://img.shields.io/badge/pub-v3.0.0-brightgreen)](https://pub.dartlang.org/packages/angel3_pub_sub) +[![version](https://img.shields.io/badge/pub-v3.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_pub_sub) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) diff --git a/packages/pub_sub/example/main.dart b/packages/pub_sub/example/main.dart index 9d4afd51..4cefcbda 100644 --- a/packages/pub_sub/example/main.dart +++ b/packages/pub_sub/example/main.dart @@ -12,7 +12,7 @@ void main() async { // Every untrusted client in your application should be pre-registered. // // In the case of Isolates, however, those are always implicitly trusted. - for (int i = 0; i < Platform.numberOfProcessors - 1; i++) { + for (var i = 0; i < Platform.numberOfProcessors - 1; i++) { server.registerClient(pub_sub.ClientInfo('client$i')); } diff --git a/packages/pub_sub/lib/src/json_rpc/client.dart b/packages/pub_sub/lib/src/json_rpc/client.dart index 7a601059..1c654bf5 100644 --- a/packages/pub_sub/lib/src/json_rpc/client.dart +++ b/packages/pub_sub/lib/src/json_rpc/client.dart @@ -100,7 +100,9 @@ class JsonRpc2Client extends Client { } } - for (var s in _subscriptions) s._close(); + for (var s in _subscriptions) { + s._close(); + } _requests.clear(); return Future.value(); @@ -119,7 +121,7 @@ class _JsonRpc2ClientSubscription extends ClientSubscription { } @override - StreamSubscription listen(void onData(event)?, + StreamSubscription listen(void Function(dynamic event)? onData, {Function? onError, void Function()? onDone, bool? cancelOnError}) { return _stream.stream.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError); diff --git a/packages/pub_sub/pubspec.yaml b/packages/pub_sub/pubspec.yaml index 5062381f..664f1b18 100644 --- a/packages/pub_sub/pubspec.yaml +++ b/packages/pub_sub/pubspec.yaml @@ -1,5 +1,5 @@ name: angel3_pub_sub -version: 3.0.0 +version: 3.0.1 description: Keep application instances in sync with a simple pub/sub API. homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/pub_sub environment: diff --git a/packages/pub_sub/test/json_rpc_2_test.dart b/packages/pub_sub/test/json_rpc_2_test.dart index 3e4d6625..ee6a33b2 100644 --- a/packages/pub_sub/test/json_rpc_2_test.dart +++ b/packages/pub_sub/test/json_rpc_2_test.dart @@ -51,12 +51,8 @@ void main() { }); tearDown(() { - Future.wait([ - server?.close(), - client1?.close(), - client2?.close(), - client3?.close() - ]); + Future.wait( + [server.close(), client1.close(), client2.close(), client3.close()]); }); group('trusted', () {