Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrServerShuttingDown = errors.New("subscription server shutting down")
ErrServerShuttingDown is an error returned in case the server is in the process of shutting down.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used to get notified about updates the caller has subscribed to,
func (*Client) Cancel ¶
func (c *Client) Cancel()
Cancel should be called in case the client no longer wants to subscribe for updates from the server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a struct that manages a set of subscriptions and their corresponding clients. Any update will be delivered to all active clients.
func (*Server) SendUpdate ¶
SendUpdate is called to send the passed update to all currently active subscription clients.
type Subscription ¶
type Subscription interface {
// Updates returns a read-only channel where the updates the client has
// subscribed to will be delivered.
Updates() <-chan interface{}
// Quit is a channel that will be closed in case the server decides to
// no longer deliver updates to this client.
Quit() <-chan struct{}
// Cancel should be called in case the client no longer wants to
// subscribe for updates from the server.
Cancel()
}
Subscription is an interface implemented by subscriptions to a server providing updates.
Click to show internal directories.
Click to hide internal directories.