JettyServer

automorph.transport.http.server.JettyServer
See theJettyServer companion object
final case class JettyServer[Effect[_]](effectSystem: EffectSystem[Effect], port: Int, pathPrefix: String, methods: Iterable[HttpMethod], webSocket: Boolean, mapException: Throwable => Int, threadPool: ThreadPool, idleTimeout: FiniteDuration, maxFrameSize: Long, attributes: Map[String, String], handler: RequestHandler[Effect, Context]) extends ServerTransport[Effect, Context]

Jetty HTTP & WebSocket server message transport plugin.

Interprets HTTP request body as an RPC request and processes it using the specified RPC request handler.

  • The response returned by the RPC request handler is used as HTTP response body.
  • Processes only HTTP requests starting with specified URL path.

Type parameters

Effect

effect type

Value parameters

attributes

server attributes

effectSystem

effect system plugin

handler

RPC request handler

idleTimeout

idle WebSocket connection timeout

mapException

maps an exception to a corresponding HTTP status code

maxFrameSize

maximum WebSocket frame size

methods

allowed HTTP request methods

pathPrefix

HTTP URL path prefix, only requests starting with this path prefix are allowed

port

port to listen on for HTTP connections

threadPool

thread pool

webSocket

support upgrading of HTTP connections to use WebSocket protocol if true, support HTTP only if false

Attributes

Constructor

Creates a Jetty HTTP server with specified RPC request handler.

See also
Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ServerTransport[Effect, Context]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def close(): Effect[Unit]

Stops this server transport freeing the underlying resources.

Stops this server transport freeing the underlying resources.

Attributes

Returns

nothing

Definition Classes
override def init(): Effect[Unit]

Starts this server to process incoming requests.

Starts this server to process incoming requests.

Attributes

Returns

active RPC server

Definition Classes
override def withHandler(handler: RequestHandler[Effect, Context]): JettyServer[Effect]

Create a copy of this server transport with specified RPC request handler.

Create a copy of this server transport with specified RPC request handler.

Value parameters

handler

RPC request handler

Attributes

Returns

server transport

Definition Classes

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Inherited fields

protected val logger: Logger

Attributes

Inherited from:
Logging (hidden)