observe

public CommandRequest observe<E extends EventMessage>(Class<E> type, Consumer<E> consumer)

Adds the passed consumer to the subscribers of the event of the passed type.

Parameters

type

the type of the event message to be received by the consumer

consumer

the consumer

<E>

the type of the event


public CommandRequest observe<E extends EventMessage>(Class<E> type, EventConsumer<E> consumer)

Adds the passed event consumer to the subscribers of the event of the passed type.

Parameters

type

the type of the event message to be received by the consumer

consumer

the consumer of the event message and its context

<E>

the type of the event