Skip to content
Unverified Commit 728fcad0 authored by Max Inden's avatar Max Inden
Browse files

network/service: Let `get_value` return a future returning a DhtEvent

So far to retrieve a value from the DHT, one would need to:

1. Trigger a DHT event query via `NetworkWorker.get_value`.

2. Somehow retrieve the event from `NetworkWorker.poll`, e.g. by having
it return the responses as a stream.

Instead of the above, this commit suggests having
`NetworkService.get_value` return a future, eventually resolving to the
DHT response. Internally this is coordinated via
`futures::sync::oneshot`, maintaining a list of subscribers for a given
DHT key, notifying each one when a new event comes in.
parent 31127944
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment