good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jrpc
Manage
Activity
Members
Labels
Plan
Issues
6
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
4
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
jrpc
Commits
b4f7b808
Verified
Commit
b4f7b808
authored
1 year ago
by
a
Browse files
Options
Downloads
Patches
Plain Diff
simplify
parent
8ba87a2f
No related branches found
No related tags found
1 merge request
!19
Simplify
Pipeline
#28673
failed with stage
in 12 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/server/server.go
+12
-1
12 additions, 1 deletion
pkg/server/server.go
with
12 additions
and
1 deletion
pkg/server/server.go
+
12
−
1
View file @
b4f7b808
...
@@ -165,6 +165,7 @@ func (s *Server) Stop() {
...
@@ -165,6 +165,7 @@ func (s *Server) Stop() {
type
callResponder
struct
{
type
callResponder
struct
{
remote
codec
.
ReaderWriter
remote
codec
.
ReaderWriter
mu
sync
.
Mutex
}
}
type
notifyEnv
struct
{
type
notifyEnv
struct
{
...
@@ -174,6 +175,9 @@ type notifyEnv struct {
...
@@ -174,6 +175,9 @@ type notifyEnv struct {
}
}
func
(
c
*
callResponder
)
notify
(
ctx
context
.
Context
,
env
*
notifyEnv
)
error
{
func
(
c
*
callResponder
)
notify
(
ctx
context
.
Context
,
env
*
notifyEnv
)
error
{
c
.
mu
.
Lock
()
defer
c
.
mu
.
Unlock
()
defer
c
.
remote
.
Flush
()
enc
:=
jx
.
GetEncoder
()
enc
:=
jx
.
GetEncoder
()
enc
.
Grow
(
4096
)
enc
.
Grow
(
4096
)
enc
.
ResetWriter
(
c
.
remote
)
enc
.
ResetWriter
(
c
.
remote
)
...
@@ -197,7 +201,11 @@ func (c *callResponder) notify(ctx context.Context, env *notifyEnv) error {
...
@@ -197,7 +201,11 @@ func (c *callResponder) notify(ctx context.Context, env *notifyEnv) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
return
enc
.
Close
()
err
=
enc
.
Close
()
if
err
!=
nil
{
return
err
}
return
nil
}
}
type
callEnv
struct
{
type
callEnv
struct
{
...
@@ -206,6 +214,9 @@ type callEnv struct {
...
@@ -206,6 +214,9 @@ type callEnv struct {
}
}
func
(
c
*
callResponder
)
send
(
ctx
context
.
Context
,
env
*
callEnv
)
(
err
error
)
{
func
(
c
*
callResponder
)
send
(
ctx
context
.
Context
,
env
*
callEnv
)
(
err
error
)
{
c
.
mu
.
Lock
()
defer
c
.
mu
.
Unlock
()
defer
c
.
remote
.
Flush
()
// notification gets nothing
// notification gets nothing
// if all msgs in batch are notification, we trigger an allSkip and write nothing
// if all msgs in batch are notification, we trigger an allSkip and write nothing
if
env
.
batch
{
if
env
.
batch
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment