PromiseHandler

class PromiseHandler[R](handler: ResultHandler[R]) extends ResultHandler[R]

A wrapper for a ResultHandler that fulfills a Promise with the result.

This is also itself a ResultHandler.

Value Params
handler

The ResultHandler that calculates the result.

Companion
object
trait ResultHandler[R]
class Object
trait Matchable
class Any

Value members

Concrete methods

def future: Future[R]

Returns a Future of the result.

Returns a Future of the result.

Returns

A future result.

override
def onDone(publisher: Publisher): Unit

Handles the end of a stream.

Handles the end of a stream.

Delegates this to the result handler and then fulfills the promise.

Definition Classes
override
def onEvent(e: Event): Unit

Handles an Event in the stream.

Handles an Event in the stream.

Delegates this to the result handler.

Definition Classes
override
def onFail(ex: Throwable, publisher: Publisher): Unit

Handles an error in the stream.

Handles an error in the stream.

Delegates this to the result handler and then fulfills the promise with a failure.

Definition Classes
override
def onInit(publisher: Publisher): Unit

Handles the initialisation of a new event stream.

Handles the initialisation of a new event stream.

Delegates this to the result handler.

Definition Classes
override
def result: R

The result of the handler.

The result of the handler.

Delegates this to the result handler.

Definition Classes

Inherited fields

val id: UUID

A unique identifier for the handler.

A unique identifier for the handler.

Returns

a unique identifier

Inherited from
EventHandler