performDocumentSearchWatch method

  1. @override
Stream<QueryResult> performDocumentSearchWatch(
  1. DocumentSearchWatchRequest request
)
override

Implementation

@override
Stream<QueryResult> performDocumentSearchWatch(
  DocumentSearchWatchRequest request,
) async* {
  final interval = request.pollingInterval ?? Duration(seconds: 5);
  while (true) {
    final result = await performDocumentSearch(
      DocumentSearchRequest(
        collection: request.collection,
        query: request.query,
        reach: request.reach,
      ),
    ).last;
    yield (result);
    await Future.delayed(interval);
  }
}