conduit 0.6.0
Modern C++23 header-only event-dispatching / event-transport library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
conduit::nats::Transport Class Reference

NATS pipe — one instance binds to a single NATS subject and carries traffic in both directions: outbound dispatch() publishes on the subject, and any inbound message on the subject is decoded via the shared event registry and delivered through the inbound sink installed at attach time. More...

#include <transport.hpp>

Inheritance diagram for conduit::nats::Transport:
Inheritance graph
[legend]
Collaboration diagram for conduit::nats::Transport:
Collaboration graph
[legend]

Public Member Functions

 Transport (Config config, std::shared_ptr< EventRegistry > registry={})
 Construct a NATS pipe.
 
 Transport (const Transport &)=delete
 
Transportoperator= (const Transport &)=delete
 
 Transport (Transport &&)=delete
 
Transportoperator= (Transport &&)=delete
 
 ~Transport () override
 
TransportScope scope () const noexcept override
 
void attach_with_sink (Bus &bus, InboundSink sink) override
 Attach to a bus using a caller-supplied inbound sink.
 
void detach () noexcept override
 
void dispatch (const EventEnvelopeView &v) override
 
void flush () override
 
bool is_connected () const noexcept
 
- Public Member Functions inherited from conduit::Transport
 Transport ()=default
 
 Transport (const Transport &)=delete
 
 Transport (Transport &&) noexcept=default
 
Transportoperator= (const Transport &)=delete
 
Transportoperator= (Transport &&) noexcept=default
 
 ~Transport () override=default
 
virtual void attach (Bus &bus)
 Attach to a bus.
 

Additional Inherited Members

- Protected Member Functions inherited from conduit::Transport
void deliver_inbound (const EventEnvelopeView &v) const
 Subclasses call this for inbound delivery instead of touching the bus directly.
 
Busbus () const noexcept
 

Detailed Description

NATS pipe — one instance binds to a single NATS subject and carries traffic in both directions: outbound dispatch() publishes on the subject, and any inbound message on the subject is decoded via the shared event registry and delivered through the inbound sink installed at attach time.

Constructor & Destructor Documentation

◆ Transport() [1/3]

conduit::nats::Transport::Transport ( Config  config,
std::shared_ptr< EventRegistry registry = {} 
)
explicit

Construct a NATS pipe.

By default decoding uses the bus's registry — pass an explicit registry to scope a transport to a restricted set of event types (e.g. an audit pipe that only deserializes audit cells).

◆ Transport() [2/3]

conduit::nats::Transport::Transport ( const Transport )
delete

◆ Transport() [3/3]

conduit::nats::Transport::Transport ( Transport &&  )
delete

◆ ~Transport()

conduit::nats::Transport::~Transport ( )
override

Member Function Documentation

◆ attach_with_sink()

void conduit::nats::Transport::attach_with_sink ( Bus bus,
InboundSink  sink 
)
overridevirtual

Attach to a bus using a caller-supplied inbound sink.

Wrappers use this to intercept the inbound leg without each transport needing to re-implement the hook.

Reimplemented from conduit::Transport.

◆ detach()

void conduit::nats::Transport::detach ( )
overridevirtualnoexcept

Reimplemented from conduit::Transport.

◆ dispatch()

void conduit::nats::Transport::dispatch ( const EventEnvelopeView v)
overridevirtual

Implements conduit::Transport.

◆ flush()

void conduit::nats::Transport::flush ( )
overridevirtual

Reimplemented from conduit::Transport.

◆ is_connected()

bool conduit::nats::Transport::is_connected ( ) const
noexcept

◆ operator=() [1/2]

Transport & conduit::nats::Transport::operator= ( const Transport )
delete

◆ operator=() [2/2]

Transport & conduit::nats::Transport::operator= ( Transport &&  )
delete

◆ scope()

TransportScope conduit::nats::Transport::scope ( ) const
inlineoverridevirtualnoexcept

Implements conduit::Transport.


The documentation for this class was generated from the following file: