Package dev.relism.flash
Interface ServerHandle
public interface ServerHandle
Public handle to the underlying HTTP transport. Returned by
create(dev.relism.flash.extension.FlashConfiguration, dev.relism.flash.routing.AbstractRouter, dev.relism.flash.routing.AbstractWsRouter)
so that FlashApp can start and stop the server
without holding a direct reference to the package-private HttpServer.-
Method Summary
Modifier and TypeMethodDescriptionstatic ServerHandlecreate(FlashConfiguration config, AbstractRouter httpRouter, AbstractWsRouter wsRouter) voidstart()Starts the accept loop on a background platform thread.voidStarts the accept loop and blocks the calling thread until the server is stopped.stop()Gracefully stops the server, draining active connections.
-
Method Details
-
start
void start()Starts the accept loop on a background platform thread. Returns immediately. -
startAndBlock
void startAndBlock()Starts the accept loop and blocks the calling thread until the server is stopped. Suitable for use inmain()when no other work is needed after startup. -
stop
CompletableFuture<Void> stop()Gracefully stops the server, draining active connections. -
create
static ServerHandle create(FlashConfiguration config, AbstractRouter httpRouter, AbstractWsRouter wsRouter) throws IOException - Throws:
IOException
-