bus

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package bus decouples channels from the agent loop with bounded queues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InboundMessage

type InboundMessage struct {
	Channel  string
	SenderID string
	ChatID   string
	Content  string
	Time     time.Time
}

func (InboundMessage) SessionKey

func (m InboundMessage) SessionKey() string

SessionKey identifies the conversation a message belongs to.

type MessageBus

type MessageBus struct {
	// contains filtered or unexported fields
}

func New

func New() *MessageBus

func (*MessageBus) Inbound

func (b *MessageBus) Inbound() <-chan InboundMessage

func (*MessageBus) Outbound

func (b *MessageBus) Outbound() <-chan OutboundMessage

func (*MessageBus) PublishInbound

func (b *MessageBus) PublishInbound(msg InboundMessage) bool

PublishInbound enqueues without blocking; a full queue drops the message loudly rather than wedging a connector.

func (*MessageBus) PublishOutbound

func (b *MessageBus) PublishOutbound(msg OutboundMessage) bool

type OutboundMessage

type OutboundMessage struct {
	Channel string
	ChatID  string
	Content string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL