Processor

object Processor
Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

final case class Aborted() extends RuntimeException

Processors can throw this exception to signalize abortion.

Processors can throw this exception to signalize abortion.

trait Body
trait Prepared
final case class Progress[Prod, Repr](processor: Repr, amount: Double) extends Update[Nothing, Repr]

An update indicating the process has progressed.

An update indicating the process has progressed.

Value Params
amount

the current progression between 0.0 and 1.0

processor

the processor that dispatched the update

final case class Result[Prod, Repr](processor: Repr, value: Try[Prod]) extends Update[Prod, Repr]

An update indicating that the process has terminated.

An update indicating that the process has terminated.

Value Params
processor

the processor that dispatched the update

value

the result which is either a Success or a Failure

sealed trait Update[+Prod, +Repr]

Value members

Concrete methods

def apply[A](name: => String)(fun: Processor[A] & Body => A)(exec: ExecutionContext): Processor[A]

Creates an ad-hoc processor from a giving body function. The function is passed the resulting processor and should make use of checkAborted and progress.

Creates an ad-hoc processor from a giving body function. The function is passed the resulting processor and should make use of checkAborted and progress.

Value Params
name

the name is purely informative and will be used for the processor's toString method

def applyWith[A](name: => String)(fun: Processor[A] & Body => Future[A])(exec: ExecutionContext): Processor[A]

Creates an ad-hoc processor from a giving body function. The function is passed the resulting processor and should make use of checkAborted and progress.

Creates an ad-hoc processor from a giving body function. The function is passed the resulting processor and should make use of checkAborted and progress.

Value Params
name

the name is purely informative and will be used for the processor's toString method

def fromFuture[A](name: String, future: Future[A])(exec: ExecutionContext): Processor[A]

Wraps an existing future in the Processor interface. The returned processor will not be able to react to abort calls, and the progress will be reported as zero until the future completes.

Wraps an existing future in the Processor interface. The returned processor will not be able to react to abort calls, and the progress will be reported as zero until the future completes.

Value Params
name

the name is purely informative and will be used for the processor's toString method

def fromProcess(name: String, process: Process)(exec: ExecutionContext): Processor[Int]

Wraps an existing shell process in the Processor interface. The returned processor will evaluate to the process' exit value. Calling abort will destroy the process.

Wraps an existing shell process in the Processor interface. The returned processor will evaluate to the process' exit value. Calling abort will destroy the process.

Value Params
name

the name is purely informative and will be used for the processor's toString method