Skip to content

ASync reader #44

Description

@h-bragg

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);
    }
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions