-
Notifications
You must be signed in to change notification settings - Fork 900
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
HttpService.orElse(HttpService) #60
Conversation
if (nextSubHandler != null && res.status().code() == HttpResponseStatus.NOT_FOUND.code()) { | ||
// The current sub-handler returned 404. Try the next sub-handler. | ||
res.release(); | ||
if (!promise.isDone()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering, when could this be true? Something like idle timeout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or unexpectedly closed connections.
898beb9
to
2ebb99a
Compare
invoke0(ctx, blockingTaskExecutor, promise, first, second); | ||
} | ||
|
||
private void invoke0(ServiceInvocationContext ctx, Executor blockingTaskExecutor, Promise<Object> promise, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
over 112 columns?
Found some longer lines... 😭 |
Motivation: It is often useful to serve some resources in one HttpService and other resources in the other HttpService. There's no way to bind such 2 services under the same path prefix. Modifications: - Add HttpService.orElse() so that a user can compose two HttpService into one - Test HttpService.orElse() using HttpFileServices - Move the resources used by HttpFileServiceTest to an appropriate directory Result: A user can combine two HttpServices: virtualHost.serviceUnder( "/foo", HttpFileService.for(...).orElse(TomcatService.for(...)));
@delegacy Fixed :-) |
👍 Let's ship it. |
HttpService.orElse(HttpService)
Motivation:
It is often useful to serve some resources in one HttpService and other
resources in the other HttpService. There's no way to bind such 2
services under the same path prefix.
Modifications:
into one
directory
Result:
A user can combine two HttpServices: