Brian Tiger Chow
fedcebf67a
refactor: re-use wantlist.Entry type wherever it makes sense
...
it seems to make sense since, in each place, the Key and Priority
represent the same information
b/c you know the saying...
"It is better to have 100 functions operate on one data structure than
10 functions on 10 data structures."
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
1d715956f5
doc: add comment to Envelope
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
e11f099c42
privatize Task
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:44 -08:00
Brian Tiger Chow
181ff4eab1
tq.Cancel -> tq.Remove
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
198aa1959a
it's not a queue yet but it's okay to name it as such
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
7280aac83f
perf: avoid lots of communication by signaling once at end of method
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
cc2a7312a2
add comment to fix race
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
b41fef2fff
refactor: remove peerKey type
...
we've been using maps with peers long enough now that this probably is
no longer necessary
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
286723d888
unexport task and taskList
...
the less bitswap has to know about, the easier it'll be for readers.
(This now returns Messages.)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
93fde86d18
refactor: taskKey := p.Key() + block.Key()
...
for clarity and to avoid errors, define a function
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
460967839e
doc: comment
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
10e970c0cf
refactor: context first in argument list
...
(merely by convention)
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:43 -08:00
Brian Tiger Chow
f66d94aaf1
fix: move the check into the function.
...
function should be a no-op when passed an empty slice
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
8c05c444a5
refactor: avoid loop reuse
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
2ea8ed81ac
refactor: change Tasks to Outbox
...
notice that moving the blockstore fetch into the manager removes the
weird error handling case.
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
a495a014af
style constify variables
...
good to const until it's required for them to be variable.
TODO pass them in as configuration options
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
8bef1dce80
fix: move to callsite so public callers don't experience the internal timeout rule
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
5603b2e0a4
style: line wrapping
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
c0a18d9c08
fix(test): nil Blockstore
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Jeromy
69dd260236
refactor peerSet
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
f533678724
avoid attaching context to object when it's not necessary.
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:42 -08:00
Brian Tiger Chow
f028c44fd2
name findOrCreate
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Brian Tiger Chow
1bced710b1
queue-like naming
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Brian Tiger Chow
29ef238fa3
remove dead code
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Brian Tiger Chow
86c438b6e1
refactor() message API
...
performing CR in the form of a PR. Let me know what you think.
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:41 -08:00
Jeromy
6389bfda6b
some cleanup before CR
2014-12-17 23:44:41 -08:00
Jeromy
2240272d85
change Provide RPC to not wait for an ACK, improves performance of 'Add' operations
2014-12-17 23:44:41 -08:00
Jeromy
90a30961de
renaming and removing empty strategy file
2014-12-17 23:44:41 -08:00
Jeromy
029e305f19
tasklist queue for bitswap tasks
2014-12-17 23:44:41 -08:00
Jeromy
cfbe92bc8b
rewrite sendWantlistToProviders
2014-12-17 23:44:40 -08:00
Jeromy
946d2a96f2
add locks to wantlist to avoid race condition
2014-12-17 23:44:40 -08:00
Brian Tiger Chow
59f0ffb8c6
remove noisy statement
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:40 -08:00
Brian Tiger Chow
da68475bcf
fix go version
...
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-12-17 23:44:40 -08:00
Jeromy
50aa37fec4
blockstore.ErrNotFound, and proper wantlist sorting
2014-12-17 23:44:40 -08:00
Jeromy
e7bba82dcb
add priorities to GetBlocks requests, and add waitgroup to sendWantListTo
2014-12-17 23:44:40 -08:00
Jeromy
3778eedff0
dont spawn so many goroutines when rebroadcasting wantlist
2014-12-17 23:44:40 -08:00
Jeromy
57e7dd7b8b
extracted ledgerset from strategy, cleaned up a few comments from the PR
2014-12-17 23:44:40 -08:00
Jeromy
5b6a5e807f
implement bitswap roundWorker
...
make vendor
2014-12-17 23:44:39 -08:00
Jeromy
12b296ee1a
create wantlist object
2014-12-17 23:44:39 -08:00
Juan Batiz-Benet
c4a935c3e3
go complains about lack of buildable file
2014-12-17 23:44:39 -08:00
Juan Batiz-Benet
911b54e526
Merge pull request #443 from jbenet/ionet-conn
...
net-io
2014-12-17 23:32:35 -08:00
Juan Batiz-Benet
4da261001f
mocknet printer for printing
2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
6acc152f0c
backpressure: explanation + more rounds
2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
db7d7ae891
net: sending backpressure test
2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
ccc17d2740
net: cool test for new stream backpressure
...
Sadly, as cool as this test is, it doesn't work
Because spdystream doesnt handle stream open backpressure
well. I'll see about rewriting that part when it becomes
a problem. More backpressure tests comming.
2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
358b8a9984
net: testing protocol
2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
ad43e1d462
testutil: peer gen with addrs
2014-12-17 23:25:41 -08:00
Juan Batiz-Benet
b573d66208
mocknet: internals test
...
Found bugs with it :)
2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
f354fa849e
mocknet: FullMesh connects to self too.
...
@maybebtc thoughts on this? dialing self should be
**possible**, so we should in general test that we do
consider that case, but not sure if this is good to expose
to clients. thoughts?
Btw, on why dialing self should be possible, we may create
little protocols which we may have a node connect to self,
say across its interfaces to test connectivity, etc...
think of it like:
> server localhost:1234 &
> curl localhost:1234
2014-12-17 23:25:40 -08:00
Juan Batiz-Benet
b0a36aabcb
mocknet: bugfix on opening conns + printer
2014-12-17 23:25:40 -08:00