Skip to content

server: allow to setup web server programatically  #2807

@jknack

Description

@jknack

All web servers implementation are discovered at runtime using the ServiceLoader mechanism. In addition to existing setup, will add:

{
   install(new NettyServer());
}

Most of configuration is still done with ServerOptions and there is no plan to allow to custom/flexible setup of internal server options (is going to be too painful).

The only internal option that is allowed to setup for now will be custom worker threadPool (when possible):

{
   ThreadPool worker = new QueuedThreadPool();
   worker.setReservedThreads(0);
   worker.setVirtualThreadsExecutor(Executors.newVirtualThreadPerTaskExecutor());

   install(new JettyServer(worker));
}

This will fix #2779 too

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions