Tabnine Logo
Eventual.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
com.hotels.styx.api.Eventual
constructor

Best Java code snippets using com.hotels.styx.api.Eventual.<init> (Showing top 11 results out of 315)

origin: HotelsDotCom/styx

private static <T> Eventual<T> fromMono(Mono<T> mono) {
  return new Eventual<>(mono);
}
origin: HotelsDotCom/styx

  @Override
  public Eventual<LiveHttpResponse> handle(LiveHttpRequest request, HttpInterceptor.Context context) {
    return new Eventual<>(client.sendRequest(request));
  }
}
origin: HotelsDotCom/styx

@Override
public Eventual<LiveHttpResponse> handle(LiveHttpRequest request, HttpInterceptor.Context context) {
  return new Eventual<>(client.sendRequest(request));
}
origin: HotelsDotCom/styx

private Collection<RemoteHost> pools(OriginState state) {
  return origins.values().stream()
      .filter(origin -> origin.state().equals(state))
      .map(origin -> {
        HttpHandler hostClient = (request, context) -> new Eventual<>(origin.hostClient.sendRequest(request));
        return remoteHost(origin.origin, hostClient, origin.hostClient);
      })
      .collect(toList());
}
origin: HotelsDotCom/styx

@Override
public Eventual<LiveHttpResponse> handle(LiveHttpRequest request, HttpInterceptor.Context context) {
  return new Eventual<>(toPublisher(Observable.<LiveHttpResponse>create(this::reload)
      .subscribeOn(Schedulers.from(executor))));
}
origin: HotelsDotCom/styx

private HttpHandler newClientHandler(BackendService backendService, OriginsInventory originsInventory, OriginStatsFactory originStatsFactory) {
  BackendServiceClient client = clientFactory.createClient(backendService, originsInventory, originStatsFactory);
  return (request, context) -> new Eventual<>(client.sendRequest(request));
}
origin: HotelsDotCom/styx

@Test
public void createFromPublisher() {
  String value = Mono.from(new Eventual<>(Flux.just("hello"))).block();
  assertEquals(value, "hello");
}
origin: HotelsDotCom/styx

  @Override
  public Eventual<LiveHttpResponse> proceed(LiveHttpRequest request) {
    try {
      return new Eventual<>(
          toPublisher(toObservable(chain.proceed(request))
              .doOnNext(response -> upstreamStatus = response.status())
              .doOnError(error -> upstreamException = true)));
    } catch (Throwable e) {
      upstreamException = true;
      throw propagate(e);
    }
  }
}
origin: HotelsDotCom/styx

  @Override
  public Eventual<LiveHttpResponse> proceed(LiveHttpRequest request) {
    requestTracker.trackRequest(request);
    if (index < interceptors.size()) {
      HttpInterceptor.Chain chain = new HttpInterceptorChain(this, index + 1);
      HttpInterceptor interceptor = interceptors.get(index);
      try {
        return interceptor.intercept(request, chain);
      } catch (Throwable e) {
        return Eventual.error(e);
      }
    }
    requestTracker.markRequestAsSent(request);
    return new Eventual<>(toPublisher(toObservable(client.handle(request, this.context))
        .compose(StandardHttpPipeline::sendErrorOnDoubleSubscription)));
  }
}
origin: HotelsDotCom/styx

@Test
public void mapsValues() {
  StepVerifier.create(new Eventual<>(Flux.just("hello")).map(String::toUpperCase))
      .expectNext("HELLO")
      .verifyComplete();
}
origin: HotelsDotCom/styx

@Override
public Eventual<LiveHttpResponse> intercept(LiveHttpRequest request, Chain originalChain) {
  StatusRecordingChain chain = new StatusRecordingChain(originalChain);
  try {
    return new Eventual<>(toPublisher(
        toObservable(plugin.intercept(request, chain))
            .doOnNext(response -> recordStatusCode(chain, response))
            .onErrorResumeNext(error -> error(recordAndWrapError(chain, error)))));
  } catch (Throwable e) {
    recordException(e);
    return Eventual.error(new PluginException(e, plugin.name()));
  }
}
com.hotels.styx.apiEventual<init>

Javadoc

Constructs a new Eventual object from an reactive streams Publisher.

Popular methods of Eventual

  • of
    Creates a new Eventual object from given value.
  • map
    Transforms an element synchronously by applying a mapping function.
  • flatMap
    Transform an element asynchronously by applying a mapping function.
  • from
    Creates a new Eventual from a CompletionStage.
  • error
    Creates a new (@link Eventual} that emits an error.
  • onError
    Transforms an error by applying an error handler function.
  • fromMono

Popular in Java

  • Reactive rest calls using spring rest template
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Path (java.nio.file)
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • JButton (javax.swing)
  • Best plugins for Eclipse
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