Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CometHandler ¶
type CometHandler struct { MessageBox chan []byte Pool *ContextPool }
func New ¶
func New() *CometHandler
func (*CometHandler) Broadcast ¶
func (c *CometHandler) Broadcast(body []byte)
func (*CometHandler) Func ¶
func (c *CometHandler) Func(rw http.ResponseWriter, r *http.Request)
func (*CometHandler) ServeHTTP ¶
func (c *CometHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type Context ¶
type Context struct { ReturnSignal chan bool ResponseWriter http.ResponseWriter Request *http.Request }
Context is the HTTP request keeper.
func NewContext ¶
func NewContext(responseWriter http.ResponseWriter, request *http.Request) *Context
NewContext return a new context.
type ContextPool ¶
func NewContextPool ¶
func NewContextPool(params ...interface{}) *ContextPool
NewContextPool returns a context pool. size : max size of the poll
func (*ContextPool) Get ¶
func (p *ContextPool) Get() *Context
func (*ContextPool) Len ¶
func (p *ContextPool) Len() int
func (*ContextPool) Put ¶
func (p *ContextPool) Put(context *Context)
Click to show internal directories.
Click to hide internal directories.