Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Host string // contains filtered or unexported fields }
Client struct
type Connection ¶
Connection handled back to the user
type Hub ¶
type Hub struct {
// contains filtered or unexported fields
}
Hub is the pub-sub server that manages the subscriptions
func NewHub ¶
func NewHub() Hub
NewHub creates a new Hub and spawns it in the background listening for messages to broadcast
func (Hub) Subscribe ¶
func (h Hub) Subscribe(feed string) *Subscription
Subscribe creates a subscription to a feed using the provided connection
func (Hub) Unsubscribe ¶
func (h Hub) Unsubscribe(feed string, sub *Subscription)
Unsubscribe removes a subscription from the feed
type Subscription ¶
type Subscription struct {
Inbox chan []byte
}
Subscription contains an inbox where the subscriber can pull messages from
Click to show internal directories.
Click to hide internal directories.