Documentation
¶
Index ¶
- Constants
- Variables
- func ConnectionManagerInit(connLimit int) (*connectionManager, error)
- func Init(ctx context.Context, connectionLimit int) (jobs.NamedFunction, error)
- func NewLogger() *logrus.Logger
- func NotifyTest(p Payload)
- func WsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
- type Instruction
- type Payload
Constants ¶
View Source
const ( INIT_FLUSH_COUNT = 1 MAX_FLUSH_ATTEMPT = 3 )
View Source
const ( MessageDisconnect = "Disconnect" MessageConnect = "Connect" )
Variables ¶
View Source
var ( // TODO(kano): - extend Logger to application name to prefix all output with service name => in this case websockets. Logger = NewLogger() MAX_BYTE_LENGTH_FLUSH = 128 )
View Source
var TestChannel *chan Payload
Functions ¶
func ConnectionManagerInit ¶
func Init ¶
Setups websockets and return an error if setup fails. If error is nil, websockets are started in the background. Websockets can be stopped by canceling the context.
func NotifyTest ¶
func NotifyTest(p Payload)
TODO(kano): change unit test to connect through real websockets, then delete this.
func WsHandler ¶
func WsHandler(w http.ResponseWriter, r *http.Request, _ httprouter.Params)
Types ¶
type Instruction ¶
type Instruction struct {
Message string // Disconnect or Connect
Assets []string // valid Assets supported within our pools
}
Instruction to subscribe and unsubscribe from WS
Source Files
¶
Click to show internal directories.
Click to hide internal directories.