Functions for creating and altering com.twitter.finagle.Server
objects independent
of any particular codec. Generally speaking codec-specific server functions
should be preferred, but these are included for comptability with older systems
configured at the server level.
Functions for creating and altering `com.twitter.finagle.Server` objects independent of any particular codec. Generally speaking codec-specific server functions should be preferred, but these are included for comptability with older systems configured at the server level.
(bind-to b p)
Configures the given ServerBuilder with a port.
Arguments:
b
: a ServerBuilderp
: the port number to bind this server toReturns:
a bound ServerBuilder
Configures the given ServerBuilder with a port. *Arguments*: * `b`: a ServerBuilder * `p`: the port number to bind this server to *Returns*: a bound ServerBuilder
(build b svc)
Given a completed ServerBuilder
and a Service
, constructs an Server
which is capable of
responding to requests.
Arguments:
b
: a ServerBuildersvc
: the Service this server will use to respond to requestsReturns:
a running instance of [[com.twitter.finagle.builder.Server]]
Given a completed `ServerBuilder` and a `Service`, constructs an `Server` which is capable of responding to requests. *Arguments*: * `b`: a ServerBuilder * `svc`: the Service this server will use to respond to requests *Returns*: a running instance of [[com.twitter.finagle.builder.Server]]
(builder)
A handy Builder for constructing Servers (i.e., binding Services to a port).
The ServerBuilder
requires the definition of codec
, bind-to
and named
.
The main class to use is [[com.twitter.finagle.builder.ServerBuilder]], as so:
(-> (builder)
(named "servicename")
(bind-to 3000)
(build some-service))
Arguments:
Returns:
a new instance of [[com.twitter.finagle.builder.ServerBuilder]].
A handy Builder for constructing Servers (i.e., binding Services to a port). The `ServerBuilder` requires the definition of `codec`, `bind-to` and `named`. The main class to use is [[com.twitter.finagle.builder.ServerBuilder]], as so: ``` (-> (builder) (named "servicename") (bind-to 3000) (build some-service)) ``` *Arguments*: * None. *Returns*: a new instance of [[com.twitter.finagle.builder.ServerBuilder]].
(close! server)
Stops the given Server.
Arguments:
server
: an instance of [[com.twitter.finagle.builder.Server]]Returns:
a Future that closes when the server stops
Stops the given Server. *Arguments*: * `server`: an instance of [[com.twitter.finagle.builder.Server]] *Returns*: a Future that closes when the server stops
(codec b cdc)
Configures the given ServerBuilder with a codec.
Arguments:
b
: a ServerBuildercdc
: a Codec, CodecFactory, or Function1 that defines the server codecReturns:
a ServerBuilder configured with the given codec
Configures the given ServerBuilder with a codec. *Arguments*: * `b`: a ServerBuilder * `cdc`: a Codec, CodecFactory, or Function1 that defines the server codec *Returns*: a ServerBuilder configured with the given codec
(max-concurrent-requests b mcr)
Configures the given ServerBuilder to accept a maximum number of concurrent requests.
Arguments:
b
: a ServerBuildermcr
: the maximum number of concurrent requestsReturns:
a ServerBuilder configured with a maximum number of concurrent requests
Configures the given ServerBuilder to accept a maximum number of concurrent requests. *Arguments*: * `b`: a ServerBuilder * `mcr`: the maximum number of concurrent requests *Returns*: a ServerBuilder configured with a maximum number of concurrent requests
(named b name)
Configures the given ServerBuilder with a name.
Arguments:
b
: a ServerBuildername
: the name of this serverReturns:
a named ServerBuilder
Configures the given ServerBuilder with a name. *Arguments*: * `b`: a ServerBuilder * `name`: the name of this server *Returns*: a named ServerBuilder
(report-to b rcvr)
Configures the given ServerBuilder to report to a stats receiver.
Arguments:
b
: a ServerBuilderrcvr
: a StatsReceiverReturns:
a ServerBuilder configured with the given stats receiver
Configures the given ServerBuilder to report to a stats receiver. *Arguments*: * `b`: a ServerBuilder * `rcvr`: a StatsReceiver *Returns*: a ServerBuilder configured with the given stats receiver
(request-timeout b d)
Configures the given ServerBuilder with a request timeout.
Arguments:
b
: a ServerBuilderd
: the duration of the request timeout for this serverReturns:
a ServerBuilder configured with the given timeout
Configures the given ServerBuilder with a request timeout. *Arguments*: * `b`: a ServerBuilder * `d`: the duration of the request timeout for this server *Returns*: a ServerBuilder configured with the given timeout
(tracer b tracer)
Configures the given ServerBuilder to use a Tracer.
Arguments:
b
: a ServerBuildertracer
: a TracerReturns:
a ServerBuilder configured with the given tracer
Configures the given ServerBuilder to use a Tracer. *Arguments*: * `b`: a ServerBuilder * `tracer`: a Tracer *Returns*: a ServerBuilder configured with the given tracer
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close