Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
b5b0419e
Commit
b5b0419e
authored
Feb 17, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
45f14a0c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
25 deletions
+12
-25
go/neo/master.go
go/neo/master.go
+12
-25
No files found.
go/neo/master.go
View file @
b5b0419e
...
...
@@ -99,7 +99,6 @@ type Master struct {
}
// nodeCome represents "node connects" event.
// XXX main <- accept
type
nodeCome
struct
{
req
*
neonet
.
Request
idReq
*
proto
.
RequestIdentification
// we received this identification request
...
...
@@ -302,7 +301,7 @@ func (m *Master) Run(ctx context.Context, l xnet.Listener) (err error) {
err
=
ctx
.
Err
()
}
xio
.
LClose
(
ctx
,
lli
)
// XXX here ok? (probbly not)
xio
.
LClose
(
ctx
,
lli
)
// XXX here ok? (prob
a
bly not)
return
err
}
...
...
@@ -1007,34 +1006,22 @@ func (m *Master) serveClient(ctx context.Context, cli *_MasteredPeer) (err error
defer
task
.
Runningf
(
&
ctx
,
"%s: serve client"
,
cli
.
node
.
NID
)(
&
err
)
clink
:=
cli
.
node
.
Link
()
// wg, ctx := errgroup.WithContext(ctx) // XXX -> sync.WorkGroup
defer
xio
.
CloseWhenDone
(
ctx
,
clink
)()
// XXX -> cli.ResetLink? (better not here)
/* XXX kill
// M -> C notifications about cluster state
wg.Go(func() error {
return m.keepPeerUpdated(ctx, clink)
})
*/
// M <- C requests handler
// wg.Go(func() error {
for
{
req
,
err
:=
clink
.
Recv1
()
if
err
!=
nil
{
return
err
}
for
{
req
,
err
:=
clink
.
Recv1
()
if
err
!=
nil
{
return
err
}
resp
:=
m
.
serveClient1
(
ctx
,
req
.
Msg
)
err
=
req
.
Reply
(
resp
)
req
.
Close
()
if
err
!=
nil
{
return
err
}
resp
:=
m
.
serveClient1
(
ctx
,
req
.
Msg
)
err
=
req
.
Reply
(
resp
)
req
.
Close
()
if
err
!=
nil
{
return
err
}
// })
//
// return wg.Wait()
}
}
// serveClient1 prepares response for 1 request from client.
...
...
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