vert-x3 / vertx-lang-kotlin

Vert.x for Kotlin
Apache License 2.0
296 stars 68 forks source link

why executeBlockingAwait return type is nullable? #160

Closed rainmanhhh closed 1 year ago

rainmanhhh commented 4 years ago

executeBlockingAwait calls awaitResult If awaitResult failed, it will throw an exception instead of return null The return type should be [T] but not [T?]

rgmz commented 4 years ago

I don't see null as synonymous with failure; some methods have @Nullable results, for example:

rainmanhhh commented 4 years ago

NOTE: the parameter is [T] but not [T: Any] so if the action return value is actually nullable(eg. [Response?]), just call it like this: executeBlockingAwait<Response?>(...) [Response?] can be omitted

tsegismont commented 1 year ago

The return type is T? because when the call succeeds, the result can be null.