jdaugherty commented on PR #16619:
URL: https://github.com/apache/grails-core/pull/16619#issuecomment-6297039681
Thanks, all seven threads and the five items outside the diff are addressed
at e25fecc45e.
**`null` through `grails-async-rxjava3`.** Fixed in the module itself rather
than documented as a difference, since it is the module the deprecation sends
everyone to. `RxPromise` carries `null` through the stream as a private
sentinel and restores it wherever a value leaves the stream: `get()`, the value
an `onComplete` callback receives, and the lists `onComplete`, `onError` and
`waitAll` deliver. `runCallable` wraps instead of returning `Void`, and the
factory's `createPromise()`, `createPromise(Class)` and the bound-promise
branch of `onComplete` wrap too. `RxPromiseNullSpec` has one feature per row of
your table plus chaining through `then { null }`, a `PromiseList` and
`onError`; run against the previous code all six fail: the unbound and
`onComplete` cases with `NullPointerException: item is null` from
`Single.just`/`Observable.just`, the chained case with `The mapper function
returned a null value`, and the task, `waitAll` and `onError` cases with the
`java.lang.Void` clas
s where `null` is expected. The existing `result == Void` assertion in
`RxPromiseSpec` is now `result == null`. The upgrade guide, What's New, the
Promises page and the skill say what changed and that the RxJava 2 factory
keeps the old behaviour.
**`findAll().toList()`.** Reworded: the methods that keep
`Observable<List<T>>` are the static `list()`, `toList()` and `list()` on a
`DetachedCriteria`, and `toListObservable()`; `findAll().toList()` is RxJava's
own and gives a `Single<List<T>>`.
**The `Flowable` example.** Took the smaller change. The page now says
Grails subscribes on the request thread, so the data service runs its query
there before the action returns, and only the delivery and the writes happen on
the IO scheduler; the "container thread released while the stream produces"
clause is gone from the paragraph above, and a sentence says that
`subscribeOn(..)` would need a session on that thread, which the data services
do not set up.
**Non-`Publisher` results.** "Grails neither streams it nor renders a view
for it, and the response holds only what the action rendered itself", as you
traced through `UrlMappingsInfoHandlerAdapter`.
**What's New heading.** Blank line added; the section is back in the TOC in
the built guide.
**Deprecation specs.** All four pin the module in parentheses,
`(grails-async-rxjava)` and so on, so a copied message fails. The two
promise-factory specs check `RxPromise` as well as the factory, in the
`GparsPromiseSpec` style, and their service-loaded feature builds through
`PromiseFactoryBuilder.build()` and asserts the single warning, as the events
specs do with `EventBusBuilder`.
**Skill.** The `RxPromise.toObservable()` example is replaced by the
`rx.Scheduler` given to the `RxEventBus` constructor, which an application can
name, and the "no code change" bullet now states the `null` behaviour of the
RxJava 3 factory and what the RxJava 2 one does instead.
Outside the diff: the RxGORM guide's installation page now names
`grails-datamapping-rx` and explains that no `RxEntity` datastore ships; the
two lazy-loading examples subscribe through `toObservable()` and
`toListObservable()`; the events page says "for RxJava 3"; the
`gradle-developer` skill table has the `grails-9-upgrade` row; the PR
description is rewritten for the current content.
On the `Observable<String>` projection: `Observable` methods are adapted
from the iterable implementers (`ObservableResultAdapter` wraps an
`IterableServiceImplementer`), so a scalar projection is cast to an `Iterable`.
Not in this PR, since it fails the same way on `9.0.x`; happy to take it as a
follow-up issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]