-
Notifications
You must be signed in to change notification settings - Fork 79
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
Add HttpServer object #591
Conversation
Update: Pushed a new commit to deprecate |
@@ -115,6 +116,7 @@ | |||
field("factories", map(object(opaque()))) | |||
)), | |||
optional("providers", map(routingObject())), | |||
optional("servers", map(routingObject())), |
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.
Are we happy with servers or do we want to go to something more common like listeners?
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.
We should think about the naming before freezing this. However listeners
sound bit like our routing objects. In fact I was thinking to rename routingObjects
to listeners
. Then you would have servers that consume traffic from the network, and listeners to process the traffic.
WDYT?
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.
We've already discussed this and it seems we can keep using our current names.
@@ -70,7 +70,7 @@ | |||
|
|||
STYX_SERVER_CONFIGURATION_SCHEMA_BUILDER = newDocument() | |||
.rootSchema(object( | |||
field("proxy", object( | |||
optional("proxy", object( |
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.
I think we need to move at least the compressResponses attribute somewhere else if it is optional now.
Don't we need any other of the attributes? factories, bossThreadsCount ... It seems bossThreadsCount was always applied to each listener/ServerBooStrap individually (we aren't sharing the NioEventLoopGroup between different BootStraps).
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.
-
compressResponses
attribute, and the other missing attributes would still work with the oldproxy
attribute. I will add them as a separate increment to the server object. I can do it straight after the PR is merged. -
Regarding The executors & thread counts. This is a know limitation and I think mentioned in the PR description. We need to think about a specific mechanism of configuring and injecting event loops into various kinks of styx objects: servers, routing objects, and providers. I'm thinking to introduce a separate
executors
block where you declare named executors, which can be then called into action from the other styx objects. For example:
executors:
ioClient:
type: NettyEventloop
config:
threads: 4
channelType: client
ioServer:
type: NettyEventloop
config:
thread: 3
channelType: server
servers:
myServer:
type: HttpServer
config:
port: 8080
handler: hostProxy
eventLoop: ioServer
routintObjects:
hostProxy:
type: HostProxy
config:
host: abc:8080
eventLoop: ioClient
(This is a separate enhancement BTW)
WDYT?
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.
Sounds good to me.
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.
Raised an issue for missing content compression: #593
Description
Adds a
HttpServer
configuration object.Also addresses #408.
httpHandler
attribute. Each object have their ownhandler
attribute.The oldproxy
is still mandatory, and would have to be deprecated in a separate increment.proxy
is no longer mandatory. It can still be used for setting the global attributes like client thread pool size. In this case it is not necessary to set any connectors.An example usage:
Configuration
Future improvements
Deprecateproxy
andhttpHandler
configuration attributes.