Package

peds.commons

util

Permalink

package util

Linear Supertypes
LazyLogging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. util
  2. LazyLogging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class Chain[A, B] extends AnyRef

    Permalink

    Implements a functional version of the Chain of Responsibility pattern.

    Implements a functional version of the Chain of Responsibility pattern. The Chain of Responsibility pattern is a GoF design pattern consisting of a source of command objects and a series of processing objects. Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next processing object in the chain.

    In this Scala version, processing steps are defined as functions, which the Chain links together via either the chainWith() or +> operations. The return value is defined as an Either[A, B]: - Left[A] to direct processing by the next handler - Right[B] to direct that processing must stop with the preceeding result.

  2. trait Clock extends () ⇒ DateTime

    Permalink
  3. implicit final class SimpleClassNameExposure extends AnyVal

    Permalink
  4. class ThreadLocal[T] extends java.lang.ThreadLocal[T] with () ⇒ T

    Permalink

    The ThreadLocal gets initialized by the init that is passed in when needed.

    The ThreadLocal gets initialized by the init that is passed in when needed. And, because it just extends java.lang.ThreadLocal, you can also call set on it too.

    Usage: val tl = new ThreadLocal(System.currentTimeMillis)

    // these three are all equivalent, and depends on your taste tl.withValue { v => System.out.println(v) } System.out.println(tl.get) System.out.println(tl())

Value Members

  1. object Chain

    Permalink
  2. object NonFatal

    Permalink

    Extractor of non-fatal Throwables.

    Extractor of non-fatal Throwables. Will not match fatal errors like VirtualMachineError (OutOfMemoryError) ThreadDeath, LinkageError and InterruptedException. StackOverflowError is matched, i.e. considered non-fatal.

    Usage to catch all harmless throwables:

    try {
      // dangerous stuff
    } catch {
      case NonFatal(e) => log.error(e, "Something not that bad")
    }
  3. object SimpleClock extends Clock with Product with Serializable

    Permalink
  4. def emptyBehavior[A, B](): PartialFunction[A, B]

    Permalink

    makes an emptyBehavior PartialFunction expression that matches no messages at all, ever.

  5. def futureT[A, B](f: (A) ⇒ B)(implicit ec: ExecutionContext): (Future[A]) ⇒ Future[B]

    Permalink

    Transforms a function into one that accepts Future arguments and outputs Future results.

    Transforms a function into one that accepts Future arguments and outputs Future results. Used in function composition that pertains to concurrent operations. TODO: MOVE INTO PEDS.

  6. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging
  7. def optionT[A, B](f: (A) ⇒ B): (Option[A]) ⇒ Option[B]

    Permalink
  8. def tryToFuture[A](t: ⇒ Try[A])(implicit ec: ExecutionContext): Future[A]

    Permalink

Inherited from LazyLogging

Inherited from AnyRef

Inherited from Any

Ungrouped