Returns a Maybe that invokes the given Callable for each individual MaybeObserver that subscribes and emits the resulting non-null item via onSuccess while considering a null result from the Callable as indication for valueless completion via {
(@NonNull Callable<? extends @Nullable T> callable)
| 1077 | * @see #fromSupplier(Supplier) |
| 1078 | */ |
| 1079 | @CheckReturnValue |
| 1080 | @NonNull |
| 1081 | @SchedulerSupport(SchedulerSupport.NONE) |
| 1082 | public static <T> Maybe<@NonNull T> fromCallable(@NonNull Callable<? extends @Nullable T> callable) { |
| 1083 | Objects.requireNonNull(callable, "callable is null"); |
| 1084 | return RxJavaPlugins.onAssembly(new MaybeFromCallable<>(callable)); |
| 1085 | } |
| 1086 | |
| 1087 | /** |
| 1088 | * Converts a {@link Future} into a {@code Maybe}, treating a {@code null} result as an indication of emptiness. |