mirror of
https://github.com/unclechu/gRPC-haskell.git
synced 2024-11-26 21:19:43 +01:00
Oops: remove runServerOps, -Network.GRPC.LowLevel.Op.Unregistered module as it is no longer needed
This commit is contained in:
parent
4780a0c8ed
commit
acefc35b8f
3 changed files with 6 additions and 20 deletions
|
@ -50,7 +50,6 @@ library
|
|||
Network.GRPC.LowLevel.CompletionQueue.Unregistered
|
||||
Network.GRPC.LowLevel.GRPC
|
||||
Network.GRPC.LowLevel.Op
|
||||
Network.GRPC.LowLevel.Op.Unregistered
|
||||
Network.GRPC.LowLevel.Server
|
||||
Network.GRPC.LowLevel.Call
|
||||
Network.GRPC.LowLevel.Call.Unregistered
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
module Network.GRPC.LowLevel.Op.Unregistered where
|
||||
|
||||
import Network.GRPC.LowLevel.GRPC
|
||||
import Network.GRPC.LowLevel.Op
|
||||
import Network.GRPC.LowLevel.CompletionQueue
|
||||
import Network.GRPC.LowLevel.Call.Unregistered as U
|
||||
|
||||
runServerOps :: U.ServerCall
|
||||
-> CompletionQueue
|
||||
-> [Op]
|
||||
-> TimeoutSeconds
|
||||
-> IO (Either GRPCIOError [OpRecvResult])
|
||||
runServerOps = runOps . U.unServerCall
|
|
@ -7,10 +7,9 @@ import Data.ByteString (ByteString)
|
|||
import Network.GRPC.LowLevel.Call (MethodName)
|
||||
import Network.GRPC.LowLevel.Call.Unregistered
|
||||
import Network.GRPC.LowLevel.CompletionQueue (TimeoutSeconds)
|
||||
import qualified Network.GRPC.LowLevel.CompletionQueue.Unregistered as U
|
||||
import Network.GRPC.LowLevel.CompletionQueue.Unregistered (serverRequestCall)
|
||||
import Network.GRPC.LowLevel.GRPC
|
||||
import Network.GRPC.LowLevel.Op (OpRecvResult (..))
|
||||
import qualified Network.GRPC.LowLevel.Op.Unregistered as U
|
||||
import Network.GRPC.LowLevel.Op (OpRecvResult (..), runOps)
|
||||
import Network.GRPC.LowLevel.Server (Server (..),
|
||||
serverOpsGetNormalCall,
|
||||
serverOpsSendNormalResponse)
|
||||
|
@ -19,7 +18,7 @@ import qualified Network.GRPC.Unsafe.Op as C
|
|||
serverCreateCall :: Server -> TimeoutSeconds
|
||||
-> IO (Either GRPCIOError ServerCall)
|
||||
serverCreateCall Server{..} timeLimit =
|
||||
U.serverRequestCall internalServer serverCQ timeLimit
|
||||
serverRequestCall internalServer serverCQ timeLimit
|
||||
|
||||
withServerCall :: Server -> TimeoutSeconds
|
||||
-> (ServerCall -> IO (Either GRPCIOError a))
|
||||
|
@ -48,7 +47,8 @@ serverHandleNormalCall s@Server{..} timeLimit srvMetadata f = do
|
|||
withServerCall s timeLimit $ \call -> do
|
||||
grpcDebug "serverHandleNormalCall(U): starting batch."
|
||||
let recvOps = serverOpsGetNormalCall srvMetadata
|
||||
opResults <- U.runServerOps call serverCQ recvOps timeLimit
|
||||
call' = unServerCall call
|
||||
opResults <- runOps call' serverCQ recvOps timeLimit
|
||||
case opResults of
|
||||
Left x -> do grpcDebug "serverHandleNormalCall(U): ops failed; aborting"
|
||||
return $ Left x
|
||||
|
@ -62,7 +62,7 @@ serverHandleNormalCall s@Server{..} timeLimit srvMetadata f = do
|
|||
let status = C.GrpcStatusOk
|
||||
let respOps = serverOpsSendNormalResponse
|
||||
respBody respMetadata status details
|
||||
respOpsResults <- U.runServerOps call serverCQ respOps timeLimit
|
||||
respOpsResults <- runOps call' serverCQ respOps timeLimit
|
||||
case respOpsResults of
|
||||
Left x -> do grpcDebug "serverHandleNormalCall(U): resp failed."
|
||||
return $ Left x
|
||||
|
|
Loading…
Reference in a new issue