ratpack.func.Action.noop()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中ratpack.func.Action.noop()方法的一些代码示例,展示了Action.noop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Action.noop()方法的具体详情如下:
包路径:ratpack.func.Action
类名称:Action
方法名:noop

Action.noop介绍

[英]Returns an action that does precisely nothing.
[中]返回完全不执行任何操作的操作。

代码示例

代码示例来源:origin: io.ratpack/ratpack-test

@Override
public void resetRequest() {
 request = Action.noop();
 cookies.clear();
}

代码示例来源:origin: io.ratpack/ratpack-exec

/**
 * Consumes the given publisher eagerly in a forked execution, buffering results until ready to be consumed by this execution.
 * <p>
 * This method is identical to {@link #fork(Action, Action)}, but uses {@link Action#noop()} for both arguments.
 *
 * @return an execution bound publisher that propagates the items of the given publisher
 * @see Streams#fork(Publisher, Action, Action)
 * @since 1.5
 */
default TransformablePublisher<T> fork() {
 return Streams.fork(this, Action.noop(), Action.noop());
}

代码示例来源:origin: io.ratpack/ratpack-core

/**
 * Creates an interceptor with no initialisation action.
 *
 * @return an interceptor with no initialisation action.
 * @see #withInit(Action)
 */
public static MDCInterceptor instance() {
 return withInit(Action.noop());
}

代码示例来源:origin: io.ratpack/ratpack-exec

/**
 * Creates a new parallel batch of the given promises.
 *
 * @param promises the promises
 * @param <T> the type of item produced by each promise
 * @return a {@link ParallelBatch}
 */
static <T> ParallelBatch<T> of(Iterable<? extends Promise<? extends T>> promises) {
 return new DefaultParallelBatch<>(promises, Action.noop());
}

代码示例来源:origin: io.ratpack/ratpack-exec

/**
 * Binds the given publisher to the current {@link Execution}.
 * <p>
 * Calls {@link #bindExec(Publisher, Action)} with {@link Action#noop()} as the disposer.
 *
 * @param publisher the publisher to bind to the execution
 * @param <T> the type of item emitted by the publisher
 * @return a new publisher that binds the given publisher to the current execution
 */
public static <T> TransformablePublisher<T> bindExec(Publisher<T> publisher) {
 return bindExec(publisher, Action.noop());
}

代码示例来源:origin: io.ratpack/ratpack-exec

/**
 * Similar to {@link #concat(Iterable, Action)}, but with a noop disposer.
 *
 * @param publishers the publishers to concatenate.
 * @param <T> the type of emitted item
 * @return a publisher that emits a single stream of elements from multiple publishers
 * @since 1.5
 */
public static <T> TransformablePublisher<T> concat(Iterable<? extends Publisher<? extends T>> publishers) {
 return new ConcatPublisher<>(Action.noop(), publishers);
}

代码示例来源:origin: io.ratpack/ratpack-exec

/**
 * Converts this promise to an operation, by effectively discarding the result.
 *
 * @return an operation
 */
default Operation operation() {
 return operation(Action.noop());
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
 public void accept(Throwable e) throws Exception {
  if (e instanceof OnErrorNotImplementedException) {
   Promise.error(e.getCause()).then(Action.noop());
  } else if (e instanceof UndeliverableException) {
   Promise.error(e.getCause()).then(Action.noop());
  } else {
   Promise.error(e).then(Action.noop());
  }
 }
}

代码示例来源:origin: io.ratpack/ratpack-core

/**
 * {@link #files(Action)}, using the default config.
 *
 * @return {@code this}
 */
default Chain files() {
 return Exceptions.uncheck(() -> files(Action.noop()));
}

代码示例来源:origin: io.ratpack/ratpack-test

public CookieHandlingRequestSpec(RequestSpec delegate) {
 super(delegate);
 onRedirect(Function.constant(Action.noop()));
 applyCookies(this);
}

代码示例来源:origin: io.ratpack/ratpack-core

/**
 * An empty set of impositions.
 * <p>
 * Possibly useful during testing.
 *
 * @return an empty set of impositions
 */
public static Impositions none() {
 return Exceptions.uncheck(() -> of(Action.noop()));
}

代码示例来源:origin: io.ratpack/ratpack-exec

/**
 * Forks a new execution and subscribes to this promise, returning a promise for its value.
 * <p>
 * This method delegates to {@link #fork(Action)} with {@link Action#noop()}.
 *
 * @return a promise
 * @since 1.4
 * @see #fork(Action)
 */
default Promise<T> fork() {
 return Exceptions.uncheck(() -> fork(Action.noop()));
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
public void onSubscribe(Subscription s) {
 try {
  subscriber.onSubscribe(s);
 } catch (final OnErrorNotImplementedException e) {
  Promise.error(e.getCause()).then(Action.noop());
 } catch (Exception e) {
  Promise.error(new UndeliverableException(e)).then(Action.noop());
 }
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
public void onComplete() {
 try {
  observer.onComplete();
 } catch (final OnErrorNotImplementedException e) {
  Promise.error(e.getCause()).then(Action.noop());
 } catch (Exception e) {
  Promise.error(new UndeliverableException(e)).then(Action.noop());
 }
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
 public void onNext(T t) {
  try {
   subscriber.onNext(t);
  } catch (final OnErrorNotImplementedException e) {
   Promise.error(e.getCause()).then(Action.noop());
  } catch (Exception e) {
   Promise.error(new UndeliverableException(e)).then(Action.noop());
  }
 }
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
public void onSubscribe(Disposable d) {
 try {
  observer.onSubscribe(d);
 } catch (final OnErrorNotImplementedException e) {
  Promise.error(e.getCause()).then(Action.noop());
 } catch (Exception e) {
  Promise.error(new UndeliverableException(e)).then(Action.noop());
 }
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
public void onError(Throwable e) {
 try {
  subscriber.onError(e);
 } catch (final OnErrorNotImplementedException e2) {
  Promise.error(e2.getCause()).then(Action.noop());
 } catch (Exception e2) {
  Promise.error(new CompositeException(e, e2)).then(Action.noop());
 }
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
public void onNext(T t) {
 try {
  observer.onNext(t);
 } catch (final OnErrorNotImplementedException e) {
  Promise.error(e.getCause()).then(Action.noop());
 } catch (Exception e) {
  Promise.error(new UndeliverableException(e)).then(Action.noop());
 }
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
public void onComplete() {
 try {
  subscriber.onComplete();
 } catch (final OnErrorNotImplementedException e) {
  Promise.error(e.getCause()).then(Action.noop());
 } catch (Exception e) {
  Promise.error(new UndeliverableException(e)).then(Action.noop());
 }
}

代码示例来源:origin: io.ratpack/ratpack-rx2

@Override
public void onError(Throwable e) {
 try {
  observer.onError(e);
 } catch (final OnErrorNotImplementedException e2) {
  Promise.error(e2.getCause()).then(Action.noop());
 } catch (Exception e2) {
  Promise.error(new CompositeException(e, e2)).then(Action.noop());
 }
}

相关文章