congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ValueSubscriber.toLazyEither
Code IndexAdd Tabnine to your IDE (free)

How to use
toLazyEither
method
in
com.oath.cyclops.types.reactive.ValueSubscriber

Best Java code snippets using com.oath.cyclops.types.reactive.ValueSubscriber.toLazyEither (Showing top 2 results out of 315)

origin: aol/cyclops

/**
 * Construct a Right Either from the supplied publisher
 * <pre>
 * {@code
 *   ReactiveSeq<Integer> stream =  ReactiveSeq.of(1,2,3);
   Either<Throwable,Integer> future = Either.fromPublisher(stream);
   //Either[1]
 *
 * }
 * </pre>
 * @param pub Publisher to construct an Either from
 * @return Either constructed from the supplied Publisher
 */
public static <T> Either<Throwable, T> fromPublisher(final Publisher<T> pub) {
  final ValueSubscriber<T> sub = ValueSubscriber.subscriber();
  pub.subscribe(sub);
  return sub.toLazyEither();
}
origin: com.oath.cyclops/cyclops

/**
 * Construct a Right Either from the supplied publisher
 * <pre>
 * {@code
 *   ReactiveSeq<Integer> stream =  ReactiveSeq.of(1,2,3);
   Either<Throwable,Integer> future = Either.fromPublisher(stream);
   //Either[1]
 *
 * }
 * </pre>
 * @param pub Publisher to construct an Either from
 * @return Either constructed from the supplied Publisher
 */
public static <T> Either<Throwable, T> fromPublisher(final Publisher<T> pub) {
  final ValueSubscriber<T> sub = ValueSubscriber.subscriber();
  pub.subscribe(sub);
  return sub.toLazyEither();
}
com.oath.cyclops.types.reactiveValueSubscribertoLazyEither

Popular methods of ValueSubscriber

  • subscriber
  • toEither
  • toMaybe
  • <init>
  • orElse
  • throwingGet
  • toFutureAsync
  • requestOne
  • toIor
  • toTry

Popular in Java

  • Parsing JSON documents to java classes using gson
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • Menu (java.awt)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Notification (javax.management)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now