Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
339dafdc
Commit
339dafdc
authored
Jan 30, 2020
by
Petar Radovic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hive peer suggester, saturation tracker
parent
2b6cbf1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
hive.go
pkg/hive/hive.go
+15
-9
No files found.
pkg/hive/hive.go
View file @
339dafdc
...
@@ -20,8 +20,10 @@ const (
...
@@ -20,8 +20,10 @@ const (
)
)
type
Service
struct
{
type
Service
struct
{
streamer
p2p
.
Streamer
streamer
p2p
.
Streamer
logger
logging
.
Logger
logger
logging
.
Logger
peerSuggester
PeerSuggester
saturationTracker
SaturationTracker
tickInterval
time
.
Duration
tickInterval
time
.
Duration
done
chan
struct
{}
done
chan
struct
{}
...
@@ -29,9 +31,11 @@ type Service struct {
...
@@ -29,9 +31,11 @@ type Service struct {
}
}
type
Options
struct
{
type
Options
struct
{
Streamer
p2p
.
Streamer
Streamer
p2p
.
Streamer
Logger
logging
.
Logger
Logger
logging
.
Logger
TickInterval
time
.
Duration
PeerSuggester
PeerSuggester
SaturationTracker
SaturationTracker
TickInterval
time
.
Duration
}
}
// PeerSuggester suggests a peer to connect to
// PeerSuggester suggests a peer to connect to
...
@@ -46,10 +50,12 @@ type SaturationTracker interface {
...
@@ -46,10 +50,12 @@ type SaturationTracker interface {
func
New
(
o
Options
)
*
Service
{
func
New
(
o
Options
)
*
Service
{
return
&
Service
{
return
&
Service
{
streamer
:
o
.
Streamer
,
streamer
:
o
.
Streamer
,
logger
:
o
.
Logger
,
logger
:
o
.
Logger
,
tickInterval
:
o
.
TickInterval
,
tickInterval
:
o
.
TickInterval
,
done
:
make
(
chan
struct
{}),
peerSuggester
:
o
.
PeerSuggester
,
saturationTracker
:
o
.
SaturationTracker
,
done
:
make
(
chan
struct
{}),
}
}
}
}
...
...
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