All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opentracing.contrib.redis.redisson.CompletableRFuture Maven / Gradle / Ivy

There is a newer version: 0.1.16
Show newest version
/*
 * Copyright 2017-2019 The OpenTracing Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
package io.opentracing.contrib.redis.redisson;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import org.redisson.api.RFuture;

public class CompletableRFuture extends CompletableFuture implements RFuture {
  private RFuture wrappedFuture;

  public CompletableRFuture(RFuture wrappedFuture) {
    this.wrappedFuture = wrappedFuture;
  }

  @Override
  public boolean isSuccess() {
    return wrappedFuture.isSuccess();
  }

  @Override
  public Throwable cause() {
    return wrappedFuture.cause();
  }

  @Override
  public T getNow() {
    return wrappedFuture.getNow();
  }

  @Override
  public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
    return wrappedFuture.await(timeout, unit);
  }

  @Override
  public boolean await(long timeoutMillis) throws InterruptedException {
    return wrappedFuture.await(timeoutMillis);
  }

  @Override
  public RFuture sync() throws InterruptedException {
    return wrappedFuture.sync();
  }

  @Override
  public RFuture syncUninterruptibly() {
    return wrappedFuture.syncUninterruptibly();
  }

  @Override
  public RFuture await() throws InterruptedException {
    return wrappedFuture.await();
  }

  @Override
  public RFuture awaitUninterruptibly() {
    return wrappedFuture.awaitUninterruptibly();
  }

  @Override
  public boolean awaitUninterruptibly(long timeout, TimeUnit unit) {
    return wrappedFuture.awaitUninterruptibly(timeout, unit);
  }

  @Override
  public boolean awaitUninterruptibly(long timeoutMillis) {
    return wrappedFuture.awaitUninterruptibly(timeoutMillis);
  }

  @Override
  public void onComplete(BiConsumer biConsumer) {
    wrappedFuture.onComplete(biConsumer);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy