3 type session interface {
4 // Receive processes a message received from the client. If
5 // the returned response is non-nil, it will be queued and
7 Receive(map[string]interface{}, []byte) []byte
9 // Filter returns true if the event should be queued for
10 // sending to the client. It should return as fast as
11 // possible, and must not block.
14 // EventMessage encodes the given event (from the front of the
15 // queue) into a form suitable to send to the client. If a
16 // non-nil error is returned, the connection is terminated. If
17 // the returned buffer is empty, nothing is sent to the client
18 // and the event is not counted in statistics.
20 // Unlike Filter, EventMessage can block without affecting
21 // other connections. If EventMessage is slow, additional
22 // incoming events will be queued. If the event queue fills
23 // up, the connection will be dropped.
24 EventMessage(*event) ([]byte, error)
26 debugLogf(string, ...interface{})