refactor: peerRequestQueue
it's a mistake to make one queue to fit all. Go's lack of algebraic
types turns a generalized queue into a monstrosity of type
checking/casting. Better to have individual queues for individual
purposes.
Conflicts:
exchange/bitswap/decision/bench_test.go
exchange/bitswap/decision/tasks/task_queue.go
fix(bitswap.decision.PRQ): if peers match, always return result of pri comparison
fix(bitswap.decision.Engine): push to the queue before notifying
TOCTOU bug
1. client notifies
2. worker checks (finds nil)
3. worker sleeps
3. client pushes (worker missed the update)
test(PQ): improve documentation and add test
test(bitswap.decision.Engine): handling received messages
License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This declarative style is simpler to compose than the imperative wiring
up of objects.
+ pass context to StartOnlineServices as parameter. one by one, trying
to remove dependencies on node state so these initialization steps can
be broken down.
See the note:
// this file is only here to prevent go src tools (like godep) from
// thinking fuseversion is not a required package by non-darwin archs.
d3view is now in its own repo:
https://github.com/jbenet/ipfs-diag-net-d3-vis
This is so we can iterate on it quickly without having to
needlessly waste CI resources.
The repo also installs it for you:
```sh
git clone github.com/jbenet/ipfs-diag-net-d3-vis d3view
cd d3view
sudo make install
```
doh! I forgot to make sure leveldb is only opened once. thanks for catching this @mappum
* You may be wondering why we don't just share pointers to FSRepos. We
want to manage the lifecycle of the FSRepo by tracking its `state`.
Thus each FSRepo/goroutine requires private instance variables. For
this reason, each `fsrepo.At(p)` caller must get its own goroutine.
* There's a test in `fsrepo` because callers desire the ability to Open
from multiple goroutines. There's a test in `component` because this
is where the actual work needs to go in order to provide the desired
contract. If the `component` package moves, the assurances need to
move along with it.
cc @whyrusleeping @jbenet
side note: there are a couple packages in FSRepo that it might be
worthwhile to extract once the dust settles on this feature-set.