Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connects to a remote event stream broker on port 1002.
func Subscribe ¶
Subscribe connects to the event stream and subscribes to a topic. Use "*" to subscribe to all events.
type Event ¶
Event is a typed message published to the event stream. Wire format: [2-byte topic length][topic][4-byte payload length][payload]
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a pub/sub event broker on port 1002. Clients connect, subscribe to topics, and publish events. The first event from a client is treated as a subscription: - Topic "*" subscribes to all events - Any other topic subscribes to that specific topic Subsequent events are published to all matching subscribers.
func (*Server) ListenAndServe ¶
ListenAndServe binds port 1002 and starts the broker.