Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASync reader #44

Open
h-bragg opened this issue Jan 12, 2018 · 1 comment
Open

ASync reader #44

h-bragg opened this issue Jan 12, 2018 · 1 comment

Comments

@h-bragg
Copy link
Contributor

h-bragg commented Jan 12, 2018

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 {
    public function handle(MessageInterface $message, callable $done) : PromiseInterface
}

class Reader {
    public function asyncRead(AsyncMessageHandler $handler, int $num) {
        // read
        $handler->handle($message, $done)
                ->then($this->acknowledge, $this->reject);
    }
}
@h-bragg
Copy link
Contributor Author

h-bragg commented Jan 12, 2018

A start I made a while ago: https://github.com/graze/queue/tree/async-queues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant