tasks.util

package tasks.util

Members list

Packages

Type members

Experimental classlikes

object Aes

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
Aes.type
class CallbackReaper(f: => Unit) extends Reaper

Attributes

Experimental
true
Supertypes
class Reaper
trait ActorLogging
trait Actor
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
class HeartBeatActor(target: ActorRef, signal: Any, listener: ActorRef)(implicit config: TasksConfig) extends Actor, ActorLogging

Attributes

Companion
object
Experimental
true
Supertypes
trait ActorLogging
trait Actor
class Object
trait Matchable
class Any
case class Latch(c: CountDownLatch)

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
abstract class Reaper extends Actor, ActorLogging

Attributes

Experimental
true
Supertypes
trait ActorLogging
trait Actor
class Object
trait Matchable
class Any
Known subtypes
case class SerializedActorRef

Utility class facilitating sending ActorRefs over the wire

Utility class facilitating sending ActorRefs over the wire

This class is not used internally in tasks, it is to be used by client code

The use case of this class is to set up real time communication between tasks

Serializers are provided for message transfer but this class is not meant for persistent storage.

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Experimental
true
Supertypes
class Reaper
trait ActorLogging
trait Actor
class Object
trait Matchable
class Any
Show all
case class SimpleSocketAddress(hostName: String, port: Int)

Holds a hostname and a port

Holds a hostname and a port

No name resolution.

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TempFile

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
TempFile.type
case class Uri(uri: String)

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Uri

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Uri.type
case class WatchMe(ref: ActorRef, answer: Boolean)

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object eq

Type safe equality http://hseeberger.github.io/blog/2013/05/31/implicits-unchained-type-safe-equality-part2/

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
eq.type

Value members

Experimental methods

def addMaps[K, V](a: Map[K, V], b: Map[K, V])(fun: (V, V) => V): Map[K, V]

Merge maps with key collision

Merge maps with key collision

Value parameters

fun

Handles key collision

Attributes

Experimental
true
def addMaps[K, V](a: Map[K, V], b: Map[K, V])(fun: (V, V) => V): Map[K, V]

Merge maps with key collision

Merge maps with key collision

Value parameters

fun

Handles key collision

Attributes

Experimental
true
def base64(b: Array[Byte]): String

Attributes

Experimental
true
def base64(s: String): Array[Byte]

Attributes

Experimental
true
def chooseNetworkPort(implicit config: TasksConfig): Int

Attributes

Experimental
true
def exec(pb: ProcessBuilder)(stdOutFunc: String => Unit)(implicit stdErrFunc: String => Unit): Int

Execute command with user function to process each line of output.

Execute command with user function to process each line of output.

Based on from http://www.jroller.com/thebugslayer/entry/executing_external_system_commands_in Creates 2 new threads: one for the stdout, one for the stderror.

Value parameters

pb

Description of the executable process

Attributes

Returns

Exit code of the process.

Experimental
true
def execGetStreamsAndCode(pb: ProcessBuilder, unsuccessfulOnErrorStream: Boolean): (List[String], List[String], Boolean)

Execute command. Returns stdout and stderr as strings, and true if it was successful.

Execute command. Returns stdout and stderr as strings, and true if it was successful.

A process is considered successful if its exit code is 0 and the error stream is empty. The latter criterion can be disabled with the unsuccessfulOnErrorStream parameter.

Value parameters

atMost

max waiting time.

pb

The process description.

unsuccessfulOnErrorStream

if true, then the process is considered as a failure if its stderr is not empty.

Attributes

Returns

(stdout,stderr,success) triples

Experimental
true
def openFileInputStream[T](fileName: File)(func: BufferedInputStream => T): T

Opens a buffered java.io.BufferedInputStream on the file. Closes it after the block is executed.

Opens a buffered java.io.BufferedInputStream on the file. Closes it after the block is executed.

Attributes

Experimental
true
def openFileOutputStream[T](fileName: File, append: Boolean)(func: BufferedOutputStream => T): T

Opens a buffered java.io.BufferedOutputStream on the file. Closes it after the block is executed.

Opens a buffered java.io.BufferedOutputStream on the file. Closes it after the block is executed.

Attributes

Experimental
true
def readBinaryFile(fileName: String): Array[Byte]

Reads file contents into a bytearray.

Reads file contents into a bytearray.

Attributes

Experimental
true
def readBinaryFile(f: File): Array[Byte]

Reads file contents into a bytearray.

Reads file contents into a bytearray.

Attributes

Experimental
true
def readBinaryStream(f: InputStream): Array[Byte]

Reads file contents into a bytearray.

Reads file contents into a bytearray.

Attributes

Experimental
true
def readStreamAndClose(is: InputStream): Iterator[Byte]

Returns an iterator on the InputStream's data.

Returns an iterator on the InputStream's data.

Closes the stream when read through.

Attributes

Experimental
true
def reflectivelyInstantiateObject[A](fqcn: String): A

Attributes

Experimental
true
def rethrow[T](messageOnError: => String, exceptionFactory: (=> String, Throwable) => Throwable)(block: => T): T

Attributes

Experimental
true
def rethrow[T](messageOnError: => String)(block: => T): T

Attributes

Experimental
true
def retry[T](n: Int)(fn: => T): Try[T]

Retry the given block n times.

Retry the given block n times.

Attributes

Experimental
true
def retryFuture[A](tag: String)(f: => Future[A], c: Int)(implicit as: ActorSystem, ec: ExecutionContext, log: Logger): Future[A]

Attributes

Experimental
true
def retryIO[A](tag: String)(f: => IO[A], c: Int)(implicit log: Logger): IO[A]

Attributes

Experimental
true
def rightOrThrow[A, E](e: Either[E, A]): A

Attributes

Experimental
true
def stackTraceAsString(t: Any): String

Attributes

Experimental
true
def useResource[A <: { def close(): Unit; }, B](param: A)(f: A => B): B

Returns the result of the block, and closes the resource.

Returns the result of the block, and closes the resource.

Value parameters

f

block using the resource

param

closeable resource

Attributes

Experimental
true
def writeBinaryToFile(fileName: String, data: Array[Byte]): Unit

Writes binary data to file.

Writes binary data to file.

Attributes

Experimental
true
def writeBinaryToFile(file: File, data: Array[Byte]): Unit

Writes binary data to file.

Writes binary data to file.

Attributes

Experimental
true
def writeBinaryToFile(data: Array[Byte]): File

Attributes

Experimental
true
def writeToFile(fileName: String, data: String): Unit

Writes text data to file.

Writes text data to file.

Attributes

Experimental
true
def writeToFile(file: File, data: String): Unit

Writes text data to file.

Writes text data to file.

Attributes

Experimental
true