TBR: Croupier: Using new discovery API
Change-Id: I2605edf9ad0c30f3575e074384d232989339ba06
diff --git a/lib/src/syncbase/discovery_client.dart b/lib/src/syncbase/discovery_client.dart
index 470dd0c..050f963 100644
--- a/lib/src/syncbase/discovery_client.dart
+++ b/lib/src/syncbase/discovery_client.dart
@@ -46,8 +46,13 @@
discovery.Scanner scanner = await _discoveryClient.scan(query);
_scanners[key] = scanner;
- scanner.onFound.listen(onFound);
- scanner.onLost.listen(onLost);
+ scanner.onUpdate.listen((discovery.Update update) {
+ if (update.updateType == discovery.UpdateType.found) {
+ onFound(update.service);
+ } else {
+ onLost(update.service.instanceId);
+ }
+ });
print('Scanning begins!');
return _scanners[key];
diff --git a/pubspec.lock b/pubspec.lock
index 265a6fd..f2e179a 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -264,7 +264,7 @@
v23discovery:
description: v23discovery
source: hosted
- version: "0.0.10"
+ version: "0.0.11"
vector_math:
description: vector_math
source: hosted
diff --git a/pubspec.yaml b/pubspec.yaml
index ea5be4e..4c1ab74 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: croupier
dependencies:
- v23discovery: ">=0.0.10 <0.1.0"
+ v23discovery: ">=0.0.11 <0.1.0"
syncbase: ">=0.0.0 <0.1.0"
flutter:
path: ../../../flutter/packages/flutter