object FutureUtil
- Alphabetic
- By Inheritance
- FutureUtil
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def catchAndDoNotAwait(future: => Future[_], failureMessage: => String, onFailure: (Throwable) => Unit = _ => (), level: => Level = Level.ERROR)(implicit loggingContext: ErrorLoggingContext): Unit
Variant of doNotAwait that also catches non-fatal errors thrown while constructing the future.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- lazy val defaultStackTraceFilter: (Thread) => Boolean
- def doNotAwait(future: Future[_], failureMessage: => String, onFailure: (Throwable) => Unit = _ => (), level: => Level = Level.ERROR)(implicit loggingContext: ErrorLoggingContext): Unit
Discard
future
and log an error if it does not complete successfully.Discard
future
and log an error if it does not complete successfully. This is useful to document that aFuture
is intentionally not being awaited upon. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logOnFailure[T](future: Future[T], failureMessage: => String, onFailure: (Throwable) => Unit = _ => (), level: => Level = Level.ERROR)(implicit loggingContext: ErrorLoggingContext): Future[T]
If the future fails, log the associated error and re-throw.
If the future fails, log the associated error and re-throw. The returned future completes after logging.
- def logOnFailureUnlessShutdown[T](future: FutureUnlessShutdown[T], failureMessage: => String, onFailure: (Throwable) => Unit = _ => (), level: => Level = Level.ERROR)(implicit loggingContext: ErrorLoggingContext): FutureUnlessShutdown[T]
If the future fails, log the associated error and re-throw.
If the future fails, log the associated error and re-throw. The returned future completes after logging.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def noisyAwaitResult[T](future: Future[T], description: => String, timeout: Duration = Duration.Inf, warnAfter: Duration = 1.minute, killAwait: (Unit) => Boolean = _ => false, stackTraceFilter: (Thread) => Boolean = defaultStackTraceFilter, onTimeout: (TimeoutException) => Unit = _ => ())(implicit loggingContext: ErrorLoggingContext): T
Await the result of a future, logging periodically if the future is taking "too long".
Await the result of a future, logging periodically if the future is taking "too long".
This function should generally not be used directly. Rather, use one of the ProcessingTimeout timeouts and wait on that one, ensuring that we do not have stray hard coded timeout values sprinkled through of our code.
- future
The future to await
- description
A description of the future, for logging
- timeout
The timeout for the future to complete within
- warnAfter
The amount of time to wait for the future to complete before starting to complain.
- killAwait
A kill-switch for the noisy await
- Annotations
- @Deprecated @SuppressWarnings()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def valueOrLog[T](future: Future[T], timeoutMessage: => String, timeout: Duration, level: Level = Level.WARN, stackTraceFilter: (Thread) => Boolean = defaultStackTraceFilter)(implicit loggingContext: ErrorLoggingContext): Option[T]
Await the completion of
future
.Await the completion of
future
. Log a message if the future does not complete withintimeout
. If thefuture
fails with an exception withintimeout
, this method rethrows the exception.Instead of using this method, you should use the respective method on one of the ProcessingTimeouts
- returns
Optionally the completed value of
future
if it successfully completes in time.
- Annotations
- @Deprecated
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])