CounterHandler

class CounterHandler extends ResultHandler[Int]

A ResultHandler that counts the events seen.

trait ResultHandler[Int]
class Object
trait Matchable
class Any

Value members

Concrete methods

override
def onEvent(e: Event): Unit

Handles an Event in the stream.

Handles an Event in the stream.

Increases the counter by one.

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

Handles the initialisation of a new event stream.

Handles the initialisation of a new event stream.

Resets the counter to 0.

Definition Classes
override
def result: Int

The result of the handler.

The result of the handler.

Simply returns the counter.

Definition Classes

Inherited methods

def onDone(publisher: Publisher): Unit

Handles the end of a stream.

Handles the end of a stream.

Value Params
publisher

The Publisher that ended the stream.

Inherited from
EventHandler
def onFail(e: Throwable, publisher: Publisher): Unit

Handles an error in the stream.

Handles an error in the stream.

Value Params
e

The throwable error that occurred.

publisher

The Publisher that threw the error.

Inherited from
EventHandler

Concrete fields

var count: Int

The counter of handled events.

The counter of handled events.

Inherited fields

val id: UUID

A unique identifier for the handler.

A unique identifier for the handler.

Returns

a unique identifier

Inherited from
EventHandler