File tree Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Expand file tree Collapse file tree 3 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 5
5
"sync"
6
6
)
7
7
8
+ // websocket endpoint such as "/status". It has a number of clients connected
9
+ // to it, and works together with an EndpointHandler to listen for the data to
10
+ // send to its clients.
8
11
type Endpoint interface {
9
12
addClient (client * wsClient )
10
13
deleteClient (client * wsClient )
Original file line number Diff line number Diff line change 4
4
"io"
5
5
)
6
6
7
+ // An EndpointHandler tells a set of listeners when they should be generating
8
+ // data for sending to clients.
7
9
type EndpointHandler struct {
8
10
listeners []ConnectionListener
9
11
dataSender io.Writer
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import (
11
11
12
12
type genData func () (interface {}, error )
13
13
14
+ // A data generator for a websocket endpoint. It will fetch data at regular intervals, and
15
+ // send it to all clients connected to the endpoint.
14
16
type TickListener struct {
15
17
done chan bool
16
18
generator genData
You can’t perform that action at this time.
0 commit comments