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
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
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
76c77c44
Verified
Commit
76c77c44
authored
1 year ago
by
a
Browse files
Options
Downloads
Patches
Plain Diff
race
parent
4d1e6fd3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!20
mod
Pipeline
#29762
failed
1 year ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/codecs/broker/broker_inproc.go
+0
-5
0 additions, 5 deletions
contrib/codecs/broker/broker_inproc.go
contrib/codecs/broker/server.go
+1
-1
1 addition, 1 deletion
contrib/codecs/broker/server.go
pkg/util/mapset/mapset.go
+2
-0
2 additions, 0 deletions
pkg/util/mapset/mapset.go
with
3 additions
and
6 deletions
contrib/codecs/broker/broker_inproc.go
+
0
−
5
View file @
76c77c44
...
@@ -3,7 +3,6 @@ package broker
...
@@ -3,7 +3,6 @@ package broker
import
(
import
(
"context"
"context"
"encoding/json"
"encoding/json"
"log"
"strings"
"strings"
"sync"
"sync"
"sync/atomic"
"sync/atomic"
...
@@ -66,13 +65,10 @@ func (b *ChannelBroker) SetDroppedMessageHandler(fn func(string, []byte)) *Chann
...
@@ -66,13 +65,10 @@ func (b *ChannelBroker) SetDroppedMessageHandler(fn func(string, []byte)) *Chann
}
}
func
(
b
*
ChannelBroker
)
ReadRequest
(
ctx
context
.
Context
)
(
json
.
RawMessage
,
func
(
json
.
RawMessage
)
error
,
error
)
{
func
(
b
*
ChannelBroker
)
ReadRequest
(
ctx
context
.
Context
)
(
json
.
RawMessage
,
func
(
json
.
RawMessage
)
error
,
error
)
{
log
.
Println
(
"start recv"
)
select
{
select
{
case
<-
ctx
.
Done
()
:
case
<-
ctx
.
Done
()
:
log
.
Println
(
"doned"
)
return
nil
,
nil
,
ctx
.
Err
()
return
nil
,
nil
,
ctx
.
Err
()
case
f
:=
<-
b
.
msgs
:
case
f
:=
<-
b
.
msgs
:
log
.
Println
(
"recv"
,
string
(
f
.
data
))
return
f
.
data
,
func
(
resp
json
.
RawMessage
)
error
{
return
f
.
data
,
func
(
resp
json
.
RawMessage
)
error
{
return
b
.
Publish
(
context
.
Background
(),
f
.
topic
,
resp
)
return
b
.
Publish
(
context
.
Background
(),
f
.
topic
,
resp
)
},
nil
},
nil
...
@@ -84,7 +80,6 @@ func (b *ChannelBroker) WriteRequest(ctx context.Context, topic string, msg json
...
@@ -84,7 +80,6 @@ func (b *ChannelBroker) WriteRequest(ctx context.Context, topic string, msg json
case
<-
ctx
.
Done
()
:
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
return
ctx
.
Err
()
case
b
.
msgs
<-
&
frame
{
data
:
msg
,
topic
:
topic
}
:
case
b
.
msgs
<-
&
frame
{
data
:
msg
,
topic
:
topic
}
:
log
.
Println
(
"wrote"
,
string
(
msg
))
}
}
return
nil
return
nil
}
}
...
...
This diff is collapsed.
Click to expand it.
contrib/codecs/broker/server.go
+
1
−
1
View file @
76c77c44
...
@@ -25,6 +25,6 @@ func (s *Server) ServeSpoke(ctx context.Context, stream ServerSpoke) {
...
@@ -25,6 +25,6 @@ func (s *Server) ServeSpoke(ctx context.Context, stream ServerSpoke) {
continue
continue
}
}
cd
:=
NewCodec
(
req
,
fn
)
cd
:=
NewCodec
(
req
,
fn
)
s
.
Server
.
ServeCodec
(
ctx
,
cd
)
go
s
.
Server
.
ServeCodec
(
ctx
,
cd
)
}
}
}
}
This diff is collapsed.
Click to expand it.
pkg/util/mapset/mapset.go
+
2
−
0
View file @
76c77c44
...
@@ -26,6 +26,8 @@ func (s *Set[T]) Remove(x T) {
...
@@ -26,6 +26,8 @@ func (s *Set[T]) Remove(x T) {
}
}
func
(
s
*
Set
[
T
])
Each
(
fn
func
(
x
T
)
bool
)
{
func
(
s
*
Set
[
T
])
Each
(
fn
func
(
x
T
)
bool
)
{
s
.
mu
.
RLock
()
defer
s
.
mu
.
RUnlock
()
for
k
:=
range
s
.
m
{
for
k
:=
range
s
.
m
{
if
!
fn
(
k
)
{
if
!
fn
(
k
)
{
return
return
...
...
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