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
0ee8a94f
Commit
0ee8a94f
authored
Dec 25, 2020
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
cab8b455
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
31 deletions
+1
-31
go/neo/t_events_test.go
go/neo/t_events_test.go
+1
-31
No files found.
go/neo/t_events_test.go
View file @
0ee8a94f
...
...
@@ -25,8 +25,6 @@ import (
"net"
"sync"
// "lab.nexedi.com/kirr/neo/go/internal/xtracing/tracetest"
"lab.nexedi.com/kirr/neo/go/neo/proto"
)
...
...
@@ -153,13 +151,10 @@ func δnode(where string, laddr string, typ proto.NodeType, num int32, state pro
// EventRouter implements NEO-specific routing of events to trace test channels.
//
// A test has to define routing rules using BranchNode, BranchState and BranchLink
XXX
// A test has to define routing rules using BranchNode, BranchState and BranchLink
.
type
EventRouter
struct
{
mu
sync
.
Mutex
// // XXX all unbranched events go to here?
// defaultq tracetest.Chan
// events specific to particular node - e.g. node starts listening,
// state on that node changes, etc...
byNode
map
[
string
/*host*/
]
string
/*stream*/
...
...
@@ -194,7 +189,6 @@ type linkDst struct {
func
NewEventRouter
()
*
EventRouter
{
return
&
EventRouter
{
// defaultq: tracetest.NewChan("default"),
byNode
:
make
(
map
[
string
]
string
),
byState
:
make
(
map
[
string
]
string
),
byLink
:
make
(
map
[
string
]
*
linkDst
),
...
...
@@ -202,29 +196,6 @@ func NewEventRouter() *EventRouter {
}
}
/*
func (r *EventRouter) AllStreams() []tracetest.Chan {
rtset := map[tracetest.Chan]int{}
rtset[r.defaultq] = 1
for _, dst := range r.byNode {
rtset[dst] = 1
}
for _, dst := range r.byState {
rtset[dst] = 1
}
for _, ldst := range r.byLink {
rtset[ldst.a] = 1
rtset[ldst.b] = 1
}
var rtv []tracetest.Chan
for dst := range rtset {
rtv = append(rtv, dst)
}
return rtv
}
*/
// hostport splits addr of for "host:port" into host and port.
//
// if the address has not the specified form returned are:
...
...
@@ -247,7 +218,6 @@ func host(addr string) string {
}
// Route routes events according to rules specified via Branch*().
//func (r *EventRouter) RouteEvent(event interface{}) (dst tracetest.Chan) {
func
(
r
*
EventRouter
)
RouteEvent
(
event
interface
{})
(
dst
/*stream*/
string
)
{
r
.
mu
.
Lock
()
defer
r
.
mu
.
Unlock
()
...
...
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