ProcessorBase

trait ProcessorBase[Prod, Repr] extends ProcessorLike[Prod, Repr] with Prepared with Body with ModelImpl[Update[Prod, Repr]] with FutureProxy[Prod]

An implementation of Processor along with Processor.Prepared that handles everything except the main processing loop. This must be specified as the only abstract method body.

An implementation of Processor along with Processor.Prepared that handles everything except the main processing loop. This must be specified as the only abstract method body.

Type Params
Prod

the result of the process

Repr

the self type of the processor

trait FutureProxy[Prod]
trait ModelImpl[Update[Prod, Repr]]
trait Body
trait Prepared
trait ProcessorLike[Prod, Repr]
trait Model[Update[Prod, Repr]]
trait Future[Prod]
trait Awaitable[Prod]
class Object
trait Matchable
class Any
trait ProcessorImpl[Prod, Repr]
trait AbstractProcessor[Prod]

Value members

Abstract methods

protected def runBody(): Future[Prod]

Concrete methods

final def abort(): Unit
final def aborted: Boolean

Returns true if the abort method had been called.

Returns true if the abort method had been called.

final def checkAborted(): Unit

Checks if the process was aborted. If so, throws an Aborted exception. The main body should not try to catch this exception, which will be handled by the underlying infrastructure. However, the main body should put resource operations in proper try ... finally blocks, so that these resources are freed when Abort exception is thrown. Alternatively, the cleanUp method can be overridden to perform such tasks.

Checks if the process was aborted. If so, throws an Aborted exception. The main body should not try to catch this exception, which will be handled by the underlying infrastructure. However, the main body should put resource operations in proper try ... finally blocks, so that these resources are freed when Abort exception is thrown. Alternatively, the cleanUp method can be overridden to perform such tasks.

protected def notifyAborted(): Unit

Subclasses may override this to be informed immediately. about an abort request. Otherwise they can pull the aborted status any time by invoking checkAborted().

Subclasses may override this to be informed immediately. about an abort request. Otherwise they can pull the aborted status any time by invoking checkAborted().

final protected def peerFuture: Future[Prod]
final def progress: Double
final def progress_=(f: Double): Unit

Invoke this to signalize progress

Invoke this to signalize progress

Value Params
f

the processor's progress in percent (0 to 1). Values outside the 0 to 1 range will be clipped.

final def start(executionContext: ExecutionContext): Unit

Inherited methods

def addListener(pf: Listener[Update[Prod, Repr]]): pf
Inherited from
ModelImpl
def andThen[U](pf: PartialFunction[Try[Prod], U])(executor: ExecutionContext): Future[Prod]
Inherited from
Future
def collect[S](pf: PartialFunction[Prod, S])(executor: ExecutionContext): Future[S]
Inherited from
Future
final protected def dispatch(update: Update[Prod, Repr]): Unit

Synchronously dispatches an update to all currently registered listeners. Non fatal exceptions are caught on a per-listener basis without stopping the dispatch.

Synchronously dispatches an update to all currently registered listeners. Non fatal exceptions are caught on a per-listener basis without stopping the dispatch.

Inherited from
ModelImpl
def failed: Future[Throwable]
Inherited from
Future
def fallbackTo[U >: Prod](that: Future[U]): Future[U]
Inherited from
Future
def filter(p: Prod => Boolean)(executor: ExecutionContext): Future[Prod]
Inherited from
Future
def flatMap[S](f: Prod => Future[S])(executor: ExecutionContext): Future[S]
Inherited from
Future
def flatten[S](ev: Prod <:< Future[S]): Future[S]
Inherited from
Future
def foreach[U](f: Prod => U)(executor: ExecutionContext): Unit
Inherited from
Future
def isCompleted: Boolean
Inherited from
FutureProxy
def map[S](f: Prod => S)(executor: ExecutionContext): Future[S]
Inherited from
Future
def mapTo[S](tag: ClassTag[S]): Future[S]
Inherited from
Future
def onComplete[U](func: Try[Prod] => U)(executor: ExecutionContext): Unit
Inherited from
FutureProxy
def ready(atMost: Duration)(permit: CanAwait): ProcessorBase[Prod, Repr]
Inherited from
FutureProxy
def recover[U >: Prod](pf: PartialFunction[Throwable, U])(executor: ExecutionContext): Future[U]
Inherited from
Future
def recoverWith[U >: Prod](pf: PartialFunction[Throwable, Future[U]])(executor: ExecutionContext): Future[U]
Inherited from
Future
protected def releaseListeners(): Unit

Removes all listeners. This is useful when disposing the model, to remove any unnecessary references.

Removes all listeners. This is useful when disposing the model, to remove any unnecessary references.

Inherited from
ModelImpl
def removeListener(pf: Listener[Update[Prod, Repr]]): Unit
Inherited from
ModelImpl
def result(atMost: Duration)(permit: CanAwait): Prod
Inherited from
FutureProxy
protected def startListening(): Unit

Subclasses can override this to issue particular actions when the first listener has been registered

Subclasses can override this to issue particular actions when the first listener has been registered

Inherited from
ModelImpl
protected def stopListening(): Unit

Subclasses can override this to issue particular actions when the last listener has been unregistered

Subclasses can override this to issue particular actions when the last listener has been unregistered

Inherited from
ModelImpl
def transform[B](f: Try[Prod] => Try[B])(executor: ExecutionContext): Future[B]
Inherited from
FutureProxy
def transform[S](s: Prod => S, f: Throwable => Throwable)(executor: ExecutionContext): Future[S]
Inherited from
Future
def transformWith[B](f: Try[Prod] => Future[B])(executor: ExecutionContext): Future[B]
Inherited from
FutureProxy
def value: Option[Try[Prod]]
Inherited from
FutureProxy
final def withFilter(p: Prod => Boolean)(executor: ExecutionContext): Future[Prod]
Inherited from
Future
def zip[U](that: Future[U]): Future[(Prod, U)]
Inherited from
Future
def zipWith[U, R](that: Future[U])(f: (Prod, U) => R)(executor: ExecutionContext): Future[R]
Inherited from
Future

Concrete fields

final protected var child: ProcessorLike[Any, Any]
protected val progressResolution: Int

The resolution at which progress reports are dispatched. The default of 100 means that a Processor.Progress message is only dispatched if the progress has advanced by at least 1 percent. Higher values give finer granularity (sub classes may override this value).

The resolution at which progress reports are dispatched. The default of 100 means that a Processor.Progress message is only dispatched if the progress has advanced by at least 1 percent. Higher values give finer granularity (sub classes may override this value).

final protected val promise: Promise[Prod]

Implicits

Implicits

final implicit protected def executionContext: ExecutionContext

Keeps a record of the execution context used for starting this processor. You may use this to start intermediate sub processes. This method may only be used in the body method.

Keeps a record of the execution context used for starting this processor. You may use this to start intermediate sub processes. This method may only be used in the body method.