com.linkedin.parseq.Task.recoverWith()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(117)

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

Task.recoverWith介绍

[英]Equivalent to recoverWith("recoverWith", func).
[中]相当于recoverWith(“recoverWith”,func)。

代码示例

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple12Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> recoverWith(final Function1<Throwable, Task<Tuple12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple9Task<T1, T2, T3, T4, T5, T6, T7, T8, T9> recoverWith(final String desc, final Function1<Throwable, Task<Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple5Task<T1, T2, T3, T4, T5> recoverWith(final Function1<Throwable, Task<Tuple5<T1, T2, T3, T4, T5>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple2Task<T1, T2> recoverWith(final String desc, final Function1<Throwable, Task<Tuple2<T1, T2>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple14Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> recoverWith(final Function1<Throwable, Task<Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple8Task<T1, T2, T3, T4, T5, T6, T7, T8> recoverWith(final String desc, final Function1<Throwable, Task<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple6Task<T1, T2, T3, T4, T5, T6> recoverWith(final String desc, final Function1<Throwable, Task<Tuple6<T1, T2, T3, T4, T5, T6>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple7Task<T1, T2, T3, T4, T5, T6, T7> recoverWith(final String desc, final Function1<Throwable, Task<Tuple7<T1, T2, T3, T4, T5, T6, T7>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple4Task<T1, T2, T3, T4> recoverWith(final Function1<Throwable, Task<Tuple4<T1, T2, T3, T4>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple11Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> recoverWith(final String desc, final Function1<Throwable, Task<Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple3Task<T1, T2, T3> recoverWith(final Function1<Throwable, Task<Tuple3<T1, T2, T3>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple3Task<T1, T2, T3> recoverWith(final String desc, final Function1<Throwable, Task<Tuple3<T1, T2, T3>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple10Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> recoverWith(final String desc, final Function1<Throwable, Task<Tuple10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>>> f) {
 return cast(Task.super.recoverWith(desc, f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple11Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> recoverWith(final Function1<Throwable, Task<Tuple11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple15Task<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> recoverWith(final Function1<Throwable, Task<Tuple15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple9Task<T1, T2, T3, T4, T5, T6, T7, T8, T9> recoverWith(final Function1<Throwable, Task<Tuple9<T1, T2, T3, T4, T5, T6, T7, T8, T9>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple8Task<T1, T2, T3, T4, T5, T6, T7, T8> recoverWith(final Function1<Throwable, Task<Tuple8<T1, T2, T3, T4, T5, T6, T7, T8>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

/**
 * {@inheritDoc}
 */
@Override
default Tuple7Task<T1, T2, T3, T4, T5, T6, T7> recoverWith(final Function1<Throwable, Task<Tuple7<T1, T2, T3, T4, T5, T6, T7>>> f) {
 return cast(Task.super.recoverWith(f));
}

代码示例来源:origin: linkedin/parseq

public void testRecoverWithSuccess(int expectedNumberOfTasks) {
 Task<String> success = getSuccessTask().recoverWith(e -> Task.callable("recover failure", () -> {
  throw new RuntimeException("recover failed!");
 } ));
 runAndWait("AbstractTaskTest.testRecoverWithSuccess", success);
 assertEquals(success.get(), TASK_VALUE);
 assertEquals(countTasks(success.getTrace()), expectedNumberOfTasks);
}

代码示例来源:origin: linkedin/parseq

public void testRecoverWithCancelled(int expectedNumberOfTasks) {
 Task<String> cancelled = getCancelledTask().recoverWith(e -> Task.callable("recover success", () -> "recovered"));
 try {
  runAndWait("AbstractTaskTest.testRecoverWithCancelled", cancelled);
  fail("should have failed");
 } catch (Exception ex) {
  assertTrue(cancelled.isFailed());
  assertTrue(Exceptions.isCancellation(cancelled.getError()));
 }
 assertEquals(countTasks(cancelled.getTrace()), expectedNumberOfTasks);
}

相关文章