Packages

  • package root
    Definition Classes
    root
  • package eu
    Definition Classes
    root
  • package shiftforward
    Definition Classes
    eu
  • package apso

    Contains ShiftForward's general-purpose utility classes and methods, as well as extensions of existing ones.

    Contains ShiftForward's general-purpose utility classes and methods, as well as extensions of existing ones.

    Definition Classes
    shiftforward
  • package actor
    Definition Classes
    apso
  • Retrier
  • package akka
    Definition Classes
    apso
  • package aws

    Wrappers around the AWS Java client libraries providing higher level interfaces.

    Wrappers around the AWS Java client libraries providing higher level interfaces.

    Definition Classes
    apso
  • package collection

    Provides new types of collections and utility classes and methods for handling and extending existing ones.

    Provides new types of collections and utility classes and methods for handling and extending existing ones.

    Definition Classes
    apso
  • package config
    Definition Classes
    apso
  • package hashing

    Provides hashing-related utilities.

    Provides hashing-related utilities.

    Definition Classes
    apso
  • package http
    Definition Classes
    apso
  • package io
    Definition Classes
    apso
  • package iterator

    Provides new types of iterators and utility classes and methods for handling and extending existing ones.

    Provides new types of iterators and utility classes and methods for handling and extending existing ones.

    Definition Classes
    apso
  • package json

    Provides utility classes and methods related to JSON handling.

    Provides utility classes and methods related to JSON handling.

    Definition Classes
    apso
  • package profiling
    Definition Classes
    apso
  • package scalaz

    Provides utility classes and methods related to scalaz classes.

    Provides utility classes and methods related to scalaz classes.

    Definition Classes
    apso
  • package time

    Provides utility classes and methods related to datetime libraries.

    Provides utility classes and methods related to datetime libraries.

    Definition Classes
    apso

package actor

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. abstract class Retrier [Req, Msg, Ack, Key] extends AnyRef

    Helper class for actors that need to retry some of the messages they send to other actors until a certain acknowledgement message (ACK) is received.

    Helper class for actors that need to retry some of the messages they send to other actors until a certain acknowledgement message (ACK) is received. Messages can be sent individually or in batches.

    This class is instantiated by providing functions that extract an identifier from sent messages and from ACK messages. This can be an arbitrary identifier, as long as it uniquely associates a received ACK with the original sent message. Optional per-message filtering functions can be given, as well as the frequency of the retries and an optional timeout. Finally, the onComplete method, which is executed after a message or group of messages is acknowledged, must be implemented.

    A Retrier can be used as follows:

    case class ChangeData(reqId: Long, data: String)
    case class ChangeDataAck(reqId: Long)
    case class Replicate(reqId: Long, data: String)
    case class ReplicateAck(reqId: Long)
    
    class Master(val replica: ActorRef) extends Actor {
      import Retrier._
    
      val retrier = new Retrier[(ActorRef, ChangeData), Replicate, ReplicateAck, Long](_.reqId, _.reqId) {
        def onComplete(req: (ActorRef, ChangeData)) = req._1 ! ChangeDataAck(req._2.reqId)
      }
    
      def receive: Receive = ({
        case msg @ ChangeData(reqId, data) =>
          // change data internally here
          retrier.dispatch((sender, msg), Replicate(reqId, data), replica)
    
      }: Receive).orRetryWith(retrier)
    }

    In the previous example, every time a Master actor receives a ChangeData message, it sends a Replicate message to a replica actor and only responds to the original sender after an acknowledgement from the replica is received. The Replicate message is retried periodically.

    Req

    the type of the triggering request

    Msg

    the type of the messages to be sent and retried

    Ack

    the type of the ACK messages

    Key

    the type of identifier or object that links a sent message to its ACK

Value Members

  1. object Retrier

    Companion object for Retrier, containing extension methods for actor Receive actions.

Ungrouped