Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
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
Show 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 {
...
@@ -99,7 +99,6 @@ type Master struct {
}
}
// nodeCome represents "node connects" event.
// nodeCome represents "node connects" event.
// XXX main <- accept
type
nodeCome
struct
{
type
nodeCome
struct
{
req
*
neonet
.
Request
req
*
neonet
.
Request
idReq
*
proto
.
RequestIdentification
// we received this identification 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) {
...
@@ -302,7 +301,7 @@ func (m *Master) Run(ctx context.Context, l xnet.Listener) (err error) {
err
=
ctx
.
Err
()
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
return
err
}
}
...
@@ -1007,18 +1006,9 @@ func (m *Master) serveClient(ctx context.Context, cli *_MasteredPeer) (err error
...
@@ -1007,18 +1006,9 @@ func (m *Master) serveClient(ctx context.Context, cli *_MasteredPeer) (err error
defer
task
.
Runningf
(
&
ctx
,
"%s: serve client"
,
cli
.
node
.
NID
)(
&
err
)
defer
task
.
Runningf
(
&
ctx
,
"%s: serve client"
,
cli
.
node
.
NID
)(
&
err
)
clink
:=
cli
.
node
.
Link
()
clink
:=
cli
.
node
.
Link
()
// wg, ctx := errgroup.WithContext(ctx) // XXX -> sync.WorkGroup
defer
xio
.
CloseWhenDone
(
ctx
,
clink
)()
// XXX -> cli.ResetLink? (better not here)
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
// M <- C requests handler
// wg.Go(func() error {
for
{
for
{
req
,
err
:=
clink
.
Recv1
()
req
,
err
:=
clink
.
Recv1
()
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -1032,9 +1022,6 @@ func (m *Master) serveClient(ctx context.Context, cli *_MasteredPeer) (err error
...
@@ -1032,9 +1022,6 @@ func (m *Master) serveClient(ctx context.Context, cli *_MasteredPeer) (err error
return
err
return
err
}
}
}
}
// })
//
// return wg.Wait()
}
}
// serveClient1 prepares response for 1 request from client.
// 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