Skip to content

Change the Handler trait to receive an Iterator of (Request, Response) pairs.#13

Merged
seanmonstar merged 2 commits intohyperium:masterfrom
reem:handler-iterator
Sep 7, 2014
Merged

Change the Handler trait to receive an Iterator of (Request, Response) pairs.#13
seanmonstar merged 2 commits intohyperium:masterfrom
reem:handler-iterator

Conversation

@reem
Copy link
Contributor

@reem reem commented Sep 7, 2014

This allows downstream users to have total control of their concurrency
strategy, while also exposing a very nice, streaming interface for frameworks
to build on.

This also resolves issues surrounding the use of IoResult as the return type
of Handler::handle, because handlers now have complete control over how to
handle internal failure.

Fixes #3
Fixes #4

reem added 2 commits September 7, 2014 09:18
…) pairs.

This allows downstream users to have total control of their concurrency
strategy, while also exposing a very nice, streaming interface for frameworks
to build on.

This also resolves issues surrounding the use of IoResult as the return type
of Handler::handle, because handlers now have complete control over how to
handle internal failure.

Fixes hyperium#3
Fixes hyperium#4
This introduces a bit of complexity to the example,
mainly the use of the try_continue! macro for dealing
with errors, but I think this is an appropriate trade-off
as users of this library are likely to be framework authors
instead of end users.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why consume the handler here?

@seanmonstar
Copy link
Member

Looks great. Just the one question.

seanmonstar added a commit that referenced this pull request Sep 7, 2014
Change the Handler trait to receive an Iterator of (Request, Response) pairs.
@seanmonstar seanmonstar merged commit 2ac1305 into hyperium:master Sep 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Concurrency Strategy is Unclear Consider a better error abstraction for the Handler trait

2 participants