Using someones implementation of an event loop and async streams, create an Asynchronous Client
removes the need for acknowledgement handler (a little bit)
interface AsyncMessageHandler {
publicfunctionhandle(MessageInterface$message, callable$done) : PromiseInterface
}
class Reader {
publicfunctionasyncRead(AsyncMessageHandler$handler, int$num) {
// read$handler->handle($message, $done)
->then($this->acknowledge, $this->reject);
}
}
Using someones implementation of an event loop and async streams, create an Asynchronous Client
removes the need for acknowledgement handler (a little bit)