-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/broadcast-trees #89
Draft
decanus
wants to merge
29
commits into
master
Choose a base branch
from
feature/broadcast-trees
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
8f98000
started working on broadcast trees
decanus 75fc828
changes
decanus 2a3b7b1
format
decanus 7584bdc
remove old tests with flood assumptions
decanus 0b12ff2
changes
decanus 526cbe4
removed peer, no more need for services either
decanus 4cd09ba
ensure that we do not forward the message back to the previous
decanus d80d866
updated
decanus 4664f0b
make sure the message is forwarded to the parent too
decanus fedabb3
using packet
decanus be28094
removes message type
decanus 46f4664
some refactoring
decanus 71b5762
graceful handling of disconnect
decanus 1827ccf
handle sending
decanus ad96b2b
updated comment
decanus f182c71
added function to get closest
decanus ae1c4d2
cleanupg
decanus 4a33456
done with subscription
decanus 3e7b35e
formatted
decanus ce8a113
fix
decanus 292f5a6
ci thinks this is better
decanus 61be6d6
cleanup
decanus e3ac2f7
unsubscribe test
decanus fbea663
tests
decanus 6ab67dd
updated
decanus 506e3e7
cleanupg
decanus 61bdfe6
using min
decanus 0dca0f8
updated
decanus 6813cdf
mergr
decanus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ identifier_name: | |
excluded: | ||
- id | ||
- to | ||
- i | ||
disabled_rules: | ||
- trailing_comma |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
CFPropertyList (3.0.1) | ||
activesupport (4.2.11.1) | ||
i18n (~> 0.7) | ||
minitest (~> 5.1) | ||
thread_safe (~> 0.3, >= 0.3.4) | ||
tzinfo (~> 1.1) | ||
algoliasearch (1.27.1) | ||
httpclient (~> 2.8, >= 2.8.3) | ||
json (>= 1.5.1) | ||
atomos (0.1.3) | ||
claide (1.0.3) | ||
cocoapods (1.8.4) | ||
activesupport (>= 4.0.2, < 5) | ||
claide (>= 1.0.2, < 2.0) | ||
cocoapods-core (= 1.8.4) | ||
cocoapods-deintegrate (>= 1.0.3, < 2.0) | ||
cocoapods-downloader (>= 1.2.2, < 2.0) | ||
cocoapods-plugins (>= 1.0.0, < 2.0) | ||
cocoapods-search (>= 1.0.0, < 2.0) | ||
cocoapods-stats (>= 1.0.0, < 2.0) | ||
cocoapods-trunk (>= 1.4.0, < 2.0) | ||
cocoapods-try (>= 1.1.0, < 2.0) | ||
colored2 (~> 3.1) | ||
escape (~> 0.0.4) | ||
fourflusher (>= 2.3.0, < 3.0) | ||
gh_inspector (~> 1.0) | ||
molinillo (~> 0.6.6) | ||
nap (~> 1.0) | ||
ruby-macho (~> 1.4) | ||
xcodeproj (>= 1.11.1, < 2.0) | ||
cocoapods-core (1.8.4) | ||
activesupport (>= 4.0.2, < 6) | ||
algoliasearch (~> 1.0) | ||
concurrent-ruby (~> 1.1) | ||
fuzzy_match (~> 2.0.4) | ||
nap (~> 1.0) | ||
cocoapods-deintegrate (1.0.4) | ||
cocoapods-downloader (1.2.2) | ||
cocoapods-plugins (1.0.0) | ||
nap | ||
cocoapods-search (1.0.0) | ||
cocoapods-stats (1.1.0) | ||
cocoapods-trunk (1.4.0) | ||
nap (>= 0.8, < 2.0) | ||
netrc (~> 0.11) | ||
cocoapods-try (1.1.0) | ||
colored2 (3.1.2) | ||
concurrent-ruby (1.1.6) | ||
escape (0.0.4) | ||
ffi (1.12.2) | ||
fourflusher (2.3.1) | ||
fuzzy_match (2.0.4) | ||
gh_inspector (1.1.3) | ||
httpclient (2.8.3) | ||
i18n (0.9.5) | ||
concurrent-ruby (~> 1.0) | ||
jazzy (0.11.1) | ||
cocoapods (~> 1.5) | ||
mustache (~> 1.1) | ||
open4 | ||
redcarpet (~> 3.4) | ||
rouge (>= 2.0.6, < 4.0) | ||
sassc (~> 2.1) | ||
sqlite3 (~> 1.3) | ||
xcinvoke (~> 0.3.0) | ||
json (2.2.0) | ||
liferaft (0.0.6) | ||
minitest (5.14.0) | ||
molinillo (0.6.6) | ||
mustache (1.1.0) | ||
nanaimo (0.2.6) | ||
nap (1.1.0) | ||
netrc (0.11.0) | ||
open4 (1.3.4) | ||
redcarpet (3.5.0) | ||
rouge (2.0.7) | ||
ruby-macho (1.4.0) | ||
sassc (2.2.1) | ||
ffi (~> 1.9) | ||
sqlite3 (1.4.1) | ||
thread_safe (0.3.6) | ||
tzinfo (1.2.6) | ||
thread_safe (~> 0.1) | ||
xcinvoke (0.3.0) | ||
liferaft (~> 0.0.6) | ||
xcodeproj (1.12.0) | ||
CFPropertyList (>= 2.3.3, < 4.0) | ||
atomos (~> 0.1.3) | ||
claide (>= 1.0.2, < 2.0) | ||
colored2 (~> 3.1) | ||
nanaimo (~> 0.2.6) | ||
xcpretty (0.3.0) | ||
rouge (~> 2.0.7) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
jazzy (= 0.11.1) | ||
xcpretty | ||
|
||
BUNDLED WITH | ||
2.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Foundation | ||
|
||
extension Array where Element == Addr { | ||
func closest(to: Addr) -> Addr? { | ||
var distance = 0 | ||
var addr: Addr? | ||
|
||
forEach { peer in | ||
let dist = peer.distance(to: to) | ||
if distance > dist { | ||
distance = dist | ||
addr = peer | ||
} | ||
} | ||
|
||
return addr | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Foundation | ||
|
||
extension Packet { | ||
static func new(topic: Data, type: TypeEnum, body: Data) -> Packet { | ||
return Packet.with { | ||
$0.topic = topic | ||
$0.type = type | ||
$0.body = body | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can just call
min(by:)
https://developer.apple.com/documentation/swift/array/2298201-minMuch more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh true