Publisher

trait Publisher

A publisher of a stream of simulation Events.

class Object
trait Matchable
class Any

Value members

Abstract methods

def doPublish(evt: Event): Unit

Publishes an event into the stream.

Publishes an event into the stream.

Value Params
evt

The event to publish.

def stopStream(): Unit

Performs any cleaning up required when the stream is finished.

Performs any cleaning up required when the stream is finished.

def subscribe(subscriber: EventHandler): Unit

Subscribes an EventHandler to the stream so they can receive events.

Subscribes an EventHandler to the stream so they can receive events.

Value Params
subscriber

The EventHandler to subscribe.

def unsubscribe(subscriber: EventHandler): Unit

Unsubscribes an EventHandler to the stream so they can stop receiving events.

Unsubscribes an EventHandler to the stream so they can stop receiving events.

Value Params
subscriber

The EventHandler to unsubscribe.

Concrete methods

def isFinalEvent(e: Event): Boolean

Checks if an event signifies the end of the stream.

Checks if an event signifies the end of the stream.

Value Params
e

The event to check.

Returns

true if it is a final event.

def publish(evt: Event): Unit

Wrapper method for doPublish that also stops the stream upon final events.

Wrapper method for doPublish that also stops the stream upon final events.