Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
getty
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wei.xuan
getty
Commits
f025e3f3
Commit
f025e3f3
authored
Jul 21, 2019
by
fangyincheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change gstime and gssync to gxtime and gxsync
parent
ba5c0707
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
getty.go
getty.go
+2
-2
session.go
session.go
+7
-7
No files found.
getty.go
View file @
f025e3f3
...
...
@@ -16,7 +16,7 @@ import (
)
import
(
g
s
sync
"github.com/dubbogo/gost/sync"
g
x
sync
"github.com/dubbogo/gost/sync"
perrors
"github.com/pkg/errors"
)
...
...
@@ -157,7 +157,7 @@ type Session interface {
SetRQLen
(
int
)
SetWQLen
(
int
)
SetWaitTime
(
time
.
Duration
)
SetTaskPool
(
*
g
s
sync
.
TaskPool
)
SetTaskPool
(
*
g
x
sync
.
TaskPool
)
GetAttribute
(
interface
{})
interface
{}
SetAttribute
(
interface
{},
interface
{})
...
...
session.go
View file @
f025e3f3
...
...
@@ -20,8 +20,8 @@ import (
)
import
(
g
s
sync
"github.com/dubbogo/gost/sync"
g
s
time
"github.com/dubbogo/gost/time"
g
x
sync
"github.com/dubbogo/gost/sync"
g
x
time
"github.com/dubbogo/gost/time"
"github.com/gorilla/websocket"
perrors
"github.com/pkg/errors"
)
...
...
@@ -45,10 +45,10 @@ const (
/////////////////////////////////////////
var
(
wheel
=
g
stime
.
NewWheel
(
gs
time
.
TimeMillisecondDuration
(
100
),
1200
)
// wheel longest span is 2 minute
wheel
=
g
xtime
.
NewWheel
(
gx
time
.
TimeMillisecondDuration
(
100
),
1200
)
// wheel longest span is 2 minute
)
func
GetTimeWheel
()
*
g
s
time
.
Wheel
{
func
GetTimeWheel
()
*
g
x
time
.
Wheel
{
return
wheel
}
...
...
@@ -73,7 +73,7 @@ type session struct {
// handle logic
maxMsgLen
int32
// task queue
tPool
*
g
s
sync
.
TaskPool
tPool
*
g
x
sync
.
TaskPool
// heartbeat
period
time
.
Duration
...
...
@@ -311,7 +311,7 @@ func (s *session) SetWaitTime(waitTime time.Duration) {
}
// set task pool
func
(
s
*
session
)
SetTaskPool
(
p
*
g
s
sync
.
TaskPool
)
{
func
(
s
*
session
)
SetTaskPool
(
p
*
g
x
sync
.
TaskPool
)
{
s
.
lock
.
Lock
()
defer
s
.
lock
.
Unlock
()
...
...
@@ -491,7 +491,7 @@ func (s *session) handleLoop() {
wsFlag
bool
wsConn
*
gettyWSConn
// start time.Time
counter
g
s
time
.
CountWatch
counter
g
x
time
.
CountWatch
inPkg
interface
{}
outPkg
interface
{}
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment