mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-26 21:19:43 +01:00
update for grpc 0.14.0
This commit is contained in:
parent
e46d0b1b7e
commit
f7e30a1c15
5 changed files with 15 additions and 2 deletions
|
@ -385,3 +385,12 @@ char* call_details_get_host(grpc_call_details* details){
|
||||||
gpr_timespec* call_details_get_deadline(grpc_call_details* details){
|
gpr_timespec* call_details_get_deadline(grpc_call_details* details){
|
||||||
return &(details->deadline);
|
return &(details->deadline);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void* grpc_server_register_method_(grpc_server* server, const char* method,
|
||||||
|
const char* host){
|
||||||
|
//NOTE: grpc 0.14.0 added more params to this function. None of our code takes
|
||||||
|
//advantage of them, so we hardcode to the equivalent of 0.13.0's behavior.
|
||||||
|
return grpc_server_register_method(server, method, host,
|
||||||
|
GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
|
@ -133,4 +133,7 @@ char* call_details_get_host(grpc_call_details* details);
|
||||||
|
|
||||||
gpr_timespec* call_details_get_deadline(grpc_call_details* details);
|
gpr_timespec* call_details_get_deadline(grpc_call_details* details);
|
||||||
|
|
||||||
|
void* grpc_server_register_method_(grpc_server* server, const char* method,
|
||||||
|
const char* host);
|
||||||
|
|
||||||
#endif //GRPC_HASKELL
|
#endif //GRPC_HASKELL
|
||||||
|
|
|
@ -173,6 +173,7 @@ clientRequest client@(Client{..}) rm@(RegisteredMethod{..})
|
||||||
grpcDebug "clientRequest(R): batch error."
|
grpcDebug "clientRequest(R): batch error."
|
||||||
return $ Left x
|
return $ Left x
|
||||||
Right rs' -> do
|
Right rs' -> do
|
||||||
|
grpcDebug $ "clientRequest(R): got " ++ show rs'
|
||||||
return $ Right $ compileNormalRequestResults (rs ++ rs')
|
return $ Right $ compileNormalRequestResults (rs ++ rs')
|
||||||
_ -> error "Streaming methods not yet implemented."
|
_ -> error "Streaming methods not yet implemented."
|
||||||
|
|
||||||
|
|
|
@ -222,7 +222,7 @@ castPeek p = peek (castPtr p)
|
||||||
{#fun grpc_server_create as ^
|
{#fun grpc_server_create as ^
|
||||||
{`ChannelArgsPtr',unReserved `Reserved'} -> `Server'#}
|
{`ChannelArgsPtr',unReserved `Reserved'} -> `Server'#}
|
||||||
|
|
||||||
{#fun grpc_server_register_method as ^
|
{#fun grpc_server_register_method_ as ^
|
||||||
{`Server', `String', `String'} -> `CallHandle' CallHandle#}
|
{`Server', `String', `String'} -> `CallHandle' CallHandle#}
|
||||||
|
|
||||||
{#fun grpc_server_register_completion_queue as ^
|
{#fun grpc_server_register_completion_queue as ^
|
||||||
|
|
|
@ -59,7 +59,7 @@ testClientTimeoutNoServer =
|
||||||
clientOnlyTest "request timeout when server DNE" $ \c -> do
|
clientOnlyTest "request timeout when server DNE" $ \c -> do
|
||||||
rm <- clientRegisterMethod c "/foo" Normal
|
rm <- clientRegisterMethod c "/foo" Normal
|
||||||
r <- clientRequest c rm 1 "Hello" mempty
|
r <- clientRequest c rm 1 "Hello" mempty
|
||||||
r @?= Left GRPCIOTimeout
|
r @?= Left GRPCIOUnknownError
|
||||||
|
|
||||||
testServerCreateDestroy :: TestTree
|
testServerCreateDestroy :: TestTree
|
||||||
testServerCreateDestroy =
|
testServerCreateDestroy =
|
||||||
|
|
Loading…
Reference in a new issue