jbenet/go-ipfs — pull request #50 by perfmode (2014-09-11 23:48:58+00:00)
Title: refactor(bitswap) internal notifications

@whyrusleeping @jbenet

Context: In the bitswap subsystem, local actors block in `GetBlock`. When results are received, a different actor responds with the value. If within the deadline, the `GetBlock` caller receives the retrieved value.

This PR introduces a simplified interface for this internal communication.

Insights:
* Within bitswap, the actors don't need anything more than simple pubsub
behavior. Wrapping and unwrapping messages proves unnecessary.

Changes:
* Simplifies the interface for both actors calling GetBlock and actors
receiving blocks on the network
* Leverages a well-tested third-party pubsub library

Design Goals:
* reduce complexity
* extract implementation details (wrapping and unwrapping data, etc)
from bitswap and let bitswap focus on composition of operations