DATAMONGO-1559 - Polishing.
Migrate off deprecated Cancellation API to Disposable.
This commit is contained in:
@@ -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();
|
||||
----
|
||||
|
||||
@@ -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();
|
||||
----
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user