MCPcopy Index your code
hub / github.com/ReactiveX/RxJava / fromCallable

Method fromCallable

src/main/java/io/reactivex/rxjava3/core/Maybe.java:1079–1085  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Calls 1

onAssemblyMethod · 0.95