DATAMONGO-1559 - Polishing.

Migrate off deprecated Cancellation API to Disposable.
This commit is contained in:
Mark Paluch
2017-03-24 17:46:41 +01:00
parent 955597bb54
commit 4fd9edf585
6 changed files with 24 additions and 20 deletions

View File

@@ -206,10 +206,10 @@ public interface PersonRepository extends ReactiveMongoRepository<Person, String
Flux<Person> stream = repository.findByFirstname("Joe");
Cancellation cancellation = stream.doOnNext(person -> System.out.println(person)).subscribe();
Disposable subscription = stream.doOnNext(person -> System.out.println(person)).subscribe();
// …
// Later: Dispose the stream
cancellation.dispose();
subscription.dispose();
----

View File

@@ -466,12 +466,12 @@ By default, MongoDB will automatically close a cursor when the client has exhaus
----
Flux<Person> stream = template.tail(query(where("name").is("Joe")), Person.class);
Cancellation cancellation = stream.doOnNext(person -> System.out.println(person)).subscribe();
Disposable subscription = stream.doOnNext(person -> System.out.println(person)).subscribe();
// …
// Later: Dispose the stream
cancellation.dispose();
subscription.dispose();
----