NatsBridge

org.mbari.oni.etc.nats.NatsBridge
class NatsBridge(sink: NatsMessage => Unit, source: Option[String] = ...) extends AutoCloseable

Translates ChangeEvents published on the ChangeBus into NatsMessages and forwards them to the sink. Only changes to concept data made by this instance are forwarded: see ChangeEvent.affectsConceptData. Remote events (learned from other instances) are never forwarded, otherwise instances would echo each other's messages forever.

Value parameters

sink

Receives the messages, typically NatsPublisher.offer

source

Stamped on each message so receivers can ignore their own messages

Attributes

Graph
Supertypes
trait AutoCloseable
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def close(): Unit

Attributes

Definition Classes
AutoCloseable
def handle(event: ChangeEvent): Option[NatsMessage]