Unverified Commit 58244ae5 authored by Xin.Zh's avatar Xin.Zh Committed by GitHub

Merge pull request #43 from zaihang365/feature/removeCodes

Feature/removeSomeCommits
parents 1d95e7c7 80031a30
......@@ -75,6 +75,7 @@ func main() {
taskPool.Close()
}
// NewHelloClientSession use for init client session
func NewHelloClientSession(session getty.Session) (err error) {
tcp.EventListener.SessionOnOpen = func(session getty.Session) {
hello.Sessions = append(hello.Sessions, session)
......
......@@ -32,7 +32,8 @@ import (
)
var (
pkgHandler = &hello.PackageHandler{}
pkgHandler = &hello.PackageHandler{}
// EventListener register event callback
EventListener = &hello.MessageHandler{}
)
......
......@@ -57,7 +57,7 @@ type Writer interface {
Write(Session, interface{}) ([]byte, error)
}
// package handler interface
// ReadWriter interface use for handle application packages
type ReadWriter interface {
Reader
Writer
......
......@@ -46,7 +46,7 @@ const (
pendingDuration = 3e9
defaultQLen = 1024
maxIovecNum = 10
MaxWheelTimeSpan = 900e9 // 900s, 15 minute
maxWheelTimeSpan = 900e9 // 900s, 15 minute
defaultSessionName = "session"
defaultTCPSessionName = "tcp-session"
......@@ -66,7 +66,7 @@ var (
func init() {
span := 100e6 // 100ms
buckets := MaxWheelTimeSpan / span
buckets := maxWheelTimeSpan / span
wheel = gxtime.NewWheel(time.Duration(span), int(buckets)) // wheel longest span is 15 minute
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment