public interface FutureDirectives
Modifier and Type | Method and Description |
---|---|
Directive<scala.Tuple1<java.lang.Throwable>> |
completeOrRecoverWith(CompleteOrRecoverWithMagnet magnet)
"Unwraps" a
Future[T] and runs the inner route when the future has failed
with the future's failure exception as an extraction of type Throwable . |
<T> Directive<scala.Tuple1<scala.util.Try<T>>> |
onComplete(scala.Function0<scala.concurrent.Future<T>> future)
"Unwraps" a
Future[T] and runs the inner route after future
completion with the future's value as an extraction of type Try[T] . |
<T> Directive<scala.Tuple1<scala.util.Try<T>>> |
onCompleteWithBreaker(org.apache.pekko.pattern.CircuitBreaker breaker,
scala.Function0<scala.concurrent.Future<T>> future)
"Unwraps" a
Future[T] and runs the inner route after future
completion with the future's value as an extraction of type T if
the supplied CircuitBreaker is closed. |
Directive<java.lang.Object> |
onSuccess(OnSuccessMagnet magnet)
"Unwraps" a
Future[T] and runs the inner route after future
completion with the future's value as an extraction of type T . |
<T> Directive<scala.Tuple1<scala.util.Try<T>>> onComplete(scala.Function0<scala.concurrent.Future<T>> future)
Future[T]
and runs the inner route after future
completion with the future's value as an extraction of type Try[T]
.
future
- (undocumented)<T> Directive<scala.Tuple1<scala.util.Try<T>>> onCompleteWithBreaker(org.apache.pekko.pattern.CircuitBreaker breaker, scala.Function0<scala.concurrent.Future<T>> future)
Future[T]
and runs the inner route after future
completion with the future's value as an extraction of type T
if
the supplied CircuitBreaker
is closed.
If the supplied CircuitBreaker
is open the request is rejected
with a CircuitBreakerOpenRejection
.
breaker
- (undocumented)future
- (undocumented)Directive<java.lang.Object> onSuccess(OnSuccessMagnet magnet)
Future[T]
and runs the inner route after future
completion with the future's value as an extraction of type T
.
If the future fails its failure Throwable is bubbled up to the nearest
ExceptionHandler.
If type T
is already a Tuple it is directly expanded into the respective
number of extractions.
magnet
- (undocumented)Directive<scala.Tuple1<java.lang.Throwable>> completeOrRecoverWith(CompleteOrRecoverWithMagnet magnet)
Future[T]
and runs the inner route when the future has failed
with the future's failure exception as an extraction of type Throwable
.
If the future succeeds the request is completed using the values marshaller
(This directive therefore requires a marshaller for the futures type to be
implicitly available.)
magnet
- (undocumented)