mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-05 10:49:42 +01:00
Merge pull request #74 from awakenetworks/phil/host-option
Add host option to high-level API
This commit is contained in:
commit
507edf803f
3 changed files with 5 additions and 1 deletions
|
@ -152,6 +152,8 @@ data ServerOptions = ServerOptions
|
||||||
-- ^ Handlers for server streaming calls.
|
-- ^ Handlers for server streaming calls.
|
||||||
, optBiDiStreamHandlers :: [Handler 'BiDiStreaming]
|
, optBiDiStreamHandlers :: [Handler 'BiDiStreaming]
|
||||||
-- ^ Handlers for bidirectional streaming calls.
|
-- ^ Handlers for bidirectional streaming calls.
|
||||||
|
, optServerHost :: Host
|
||||||
|
-- ^ Name of the host the server is running on.
|
||||||
, optServerPort :: Port
|
, optServerPort :: Port
|
||||||
-- ^ Port on which to listen for requests.
|
-- ^ Port on which to listen for requests.
|
||||||
, optUseCompression :: Bool
|
, optUseCompression :: Bool
|
||||||
|
@ -174,6 +176,7 @@ defaultOptions = ServerOptions
|
||||||
, optClientStreamHandlers = []
|
, optClientStreamHandlers = []
|
||||||
, optServerStreamHandlers = []
|
, optServerStreamHandlers = []
|
||||||
, optBiDiStreamHandlers = []
|
, optBiDiStreamHandlers = []
|
||||||
|
, optServerHost = "localhost"
|
||||||
, optServerPort = 50051
|
, optServerPort = 50051
|
||||||
, optUseCompression = False
|
, optUseCompression = False
|
||||||
, optUserAgentPrefix = "grpc-haskell/0.0.0"
|
, optUserAgentPrefix = "grpc-haskell/0.0.0"
|
||||||
|
|
|
@ -82,7 +82,7 @@ serverLoop ServerOptions{..} = do
|
||||||
wait tid
|
wait tid
|
||||||
where
|
where
|
||||||
config = ServerConfig
|
config = ServerConfig
|
||||||
{ host = "localhost"
|
{ host = optServerHost
|
||||||
, port = optServerPort
|
, port = optServerPort
|
||||||
, methodsToRegisterNormal = []
|
, methodsToRegisterNormal = []
|
||||||
, methodsToRegisterClientStreaming = []
|
, methodsToRegisterClientStreaming = []
|
||||||
|
|
|
@ -31,6 +31,7 @@ GRPC
|
||||||
, Arg(..)
|
, Arg(..)
|
||||||
, CompressionAlgorithm(..)
|
, CompressionAlgorithm(..)
|
||||||
, CompressionLevel(..)
|
, CompressionLevel(..)
|
||||||
|
, Host
|
||||||
, Port
|
, Port
|
||||||
|
|
||||||
-- * Server
|
-- * Server
|
||||||
|
|
Loading…
Reference in a new issue