rummage
package rummage
The rummage
package is a collection of small Scala utilities.
This package consists of self-contained utilities that are too small and general to warrant their own package and/or artifact, but are too large, nuanced or handy to have around to be re-implemented over and over again.
- Alphabetic
- By Inheritance
- rummage
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
case class
AkkaClock
(akkaScheduler: Scheduler) extends SystemTime with SyncWaitBySleeping with AsyncWaitWithAkkaScheduler with Product with Serializable
A clock for use in Akka actors, using system time and Thread.sleep()
for synchronous waiting, but using an Akka
Scheduler
for asynchronous waiting.A clock for use in Akka actors, using system time and Thread.sleep()
for synchronous waiting, but using an Akka
Scheduler
for asynchronous waiting.- akkaScheduler
The Akka scheduler to use.
-
trait
AkkaClocks
extends AnyRef
A trait that defines when an implicit Akka clock is available.
-
trait
Clock
extends AnyRef
A low-level abstraction over time.
A low-level abstraction over time. This class supports querying the absolute time and the monitoring flow of time as well as waiting for future times both synchronously and asynchronously.
-
case class
DeadlineException
(duration: FiniteDuration) extends RuntimeException with NoStackTrace with Product with Serializable
The exception returned when a deadline cannot be met.
The exception returned when a deadline cannot be met.
- duration
The time limit that was exceeded.
-
trait
Deadlines
extends AnyRef
Definition of the deadline DSL.
-
case class
ScaledClock
(factor: Double)(implicit clock: Clock) extends Clock with Product with Serializable
A clock that scales the progression of time reported by another clock.
A clock that scales the progression of time reported by another clock.
The provided
factor
maps time from the underlying clock into time for the scaled clock. For example: a scale of2.0
will result in the scaled clock reporting the passage of time twice as quickly as the underlying clock, since every second of real time equates to two seconds of scaled time. Conversely, a scale of0.5
will result in the scaled clock reporting the passage of time half as quickly as the underlying clock.- factor
The scaling factor to apply to the passage of time.
- clock
The underlying clock to scale the time of.
-
final
class
AkkaTimer
extends Timer
A timer implemented with an Akka
Scheduler
.A timer implemented with an Akka
Scheduler
.- Annotations
- @deprecated
- Deprecated
(Since version 1.1) Timers are replaced by the Clock API
-
final
class
JavaTimer
extends Timer
A timer implemented with a Java
ScheduledExecutorService
.A timer implemented with a Java
ScheduledExecutorService
.- Annotations
- @deprecated
- Deprecated
(Since version 1.1) Timers are replaced by the Clock API
-
trait
Timer
extends AnyRef
An interface for scheduling tasks to run one or more times at some point in the future.
An interface for scheduling tasks to run one or more times at some point in the future.
- Annotations
- @deprecated
- Deprecated
(Since version 1.1) Timers are replaced by the Clock API
Value Members
-
object
AkkaClock
extends Serializable
Support for the
AkkaClock
class. -
object
AkkaClocks
extends AkkaClocks
Global access to the implicit Akka clock publisher.
-
object
Clock
Primary factory and resolver for instances of
Clock
. -
object
Deadline
A factory for deadline-bound futures.
-
object
Deadlines
extends Deadlines
Global implementation of the deadline DSL.
-
object
ScaledClock
extends Serializable
A factory for scaled clocks.
-
object
TryAll
An extension to the
scala.util.Try
interface to support aggregated try operations.An extension to the
scala.util.Try
interface to support aggregated try operations.This API extends Scala's
Try
to support situations where you haveTry[_ <: Iterable[_]]
and want to attempt an operation on all elements of theIterable
contained in theTry
and flatten the results of those operations into a singleTry
.This API provides two mechanisms by which you can attempt operations on aggregations:
(_: Try[_ <: Iterable[_]]).onEach
exposes combinators that will *fail fast*, meaning that it will apply a function to each member of the aggregate and will abort immediately if it encounters a failure on any member.(_: Try[_ <: Iterable[_]]).onEvery
exposes combinators that will *fail eventually*, meaning that it will apply a function to every member of the aggregate, collecting any failures it encounters and returning them after all elements have been processed.
Additionally, this API extends
scala.util.Failure
with two new failure abstractions:Problem
provides a factory and extractor for failures that carry only a message and no stack trace.Failures
provides a factory and extractor for failures that are only aggregations of other failures.
Deprecated Value Members
-
object
AkkaTimer
Factory for timers implemented with an Akka
Scheduler
.Factory for timers implemented with an Akka
Scheduler
.- Annotations
- @deprecated
- Deprecated
(Since version 1.1) Timers are replaced by the Clock API
-
object
JavaTimer
Factory for timers implemented with a Java
ScheduledExecutorService
.Factory for timers implemented with a Java
ScheduledExecutorService
.- Annotations
- @deprecated
- Deprecated
(Since version 1.1) Timers are replaced by the Clock API
-
object
Timer
extends Timer
Definitions associated with timers as well as the infrastructure for publishing the global implicit timer.
Definitions associated with timers as well as the infrastructure for publishing the global implicit timer.
This object publishes an implicit, lazily-initialized, global timer backed by a single daemon thread. It additionally implements
Timer
itself and forwards all task submissions to the aforementioned global timer.- Annotations
- @deprecated
- Deprecated
(Since version 1.1) Timers are replaced by the Clock API