Closed gavin-norman-sociomantic closed 6 years ago
Some apps are already adapted to use the existing RetryHandshake
in a task-blocking manner. Code like the following indicates that this is simple:
override public void waitForFullHandshake ( )
{
auto task = Task.getThis();
assert(task !is null);
bool done;
new RetryHandshake(theScheduler.epoll, this.dht, RETRY_WAIT, {
done = true;
if ( task.suspended ) task.resume;
});
if ( !done ) task.suspend();
}
Given the simple usage of RetryHandshake
with tasks and the fact that the exact behaviour required for partial handshakes varies greatly by application, I'm not sure it's worth adding anything more to dhtproto.
Either a new implementation or a derived class.
Some applications already have code for this, so it's probably just a case of surveying what we already have, checking it's generic enough for a library, and bringing it in.