Oops: remove runServerOps, -Network.GRPC.LowLevel.Op.Unregistered module as it is no longer needed

This commit is contained in:
Joel Stanley 2016-06-08 15:53:09 -05:00
parent 4780a0c8ed
commit acefc35b8f
3 changed files with 6 additions and 20 deletions

View file

@ -50,7 +50,6 @@ library
Network.GRPC.LowLevel.CompletionQueue.Unregistered Network.GRPC.LowLevel.CompletionQueue.Unregistered
Network.GRPC.LowLevel.GRPC Network.GRPC.LowLevel.GRPC
Network.GRPC.LowLevel.Op Network.GRPC.LowLevel.Op
Network.GRPC.LowLevel.Op.Unregistered
Network.GRPC.LowLevel.Server Network.GRPC.LowLevel.Server
Network.GRPC.LowLevel.Call Network.GRPC.LowLevel.Call
Network.GRPC.LowLevel.Call.Unregistered Network.GRPC.LowLevel.Call.Unregistered

View file

@ -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

View file

@ -7,10 +7,9 @@ import Data.ByteString (ByteString)
import Network.GRPC.LowLevel.Call (MethodName) import Network.GRPC.LowLevel.Call (MethodName)
import Network.GRPC.LowLevel.Call.Unregistered import Network.GRPC.LowLevel.Call.Unregistered
import Network.GRPC.LowLevel.CompletionQueue (TimeoutSeconds) 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.GRPC
import Network.GRPC.LowLevel.Op (OpRecvResult (..)) import Network.GRPC.LowLevel.Op (OpRecvResult (..), runOps)
import qualified Network.GRPC.LowLevel.Op.Unregistered as U
import Network.GRPC.LowLevel.Server (Server (..), import Network.GRPC.LowLevel.Server (Server (..),
serverOpsGetNormalCall, serverOpsGetNormalCall,
serverOpsSendNormalResponse) serverOpsSendNormalResponse)
@ -19,7 +18,7 @@ import qualified Network.GRPC.Unsafe.Op as C
serverCreateCall :: Server -> TimeoutSeconds serverCreateCall :: Server -> TimeoutSeconds
-> IO (Either GRPCIOError ServerCall) -> IO (Either GRPCIOError ServerCall)
serverCreateCall Server{..} timeLimit = serverCreateCall Server{..} timeLimit =
U.serverRequestCall internalServer serverCQ timeLimit serverRequestCall internalServer serverCQ timeLimit
withServerCall :: Server -> TimeoutSeconds withServerCall :: Server -> TimeoutSeconds
-> (ServerCall -> IO (Either GRPCIOError a)) -> (ServerCall -> IO (Either GRPCIOError a))
@ -48,7 +47,8 @@ serverHandleNormalCall s@Server{..} timeLimit srvMetadata f = do
withServerCall s timeLimit $ \call -> do withServerCall s timeLimit $ \call -> do
grpcDebug "serverHandleNormalCall(U): starting batch." grpcDebug "serverHandleNormalCall(U): starting batch."
let recvOps = serverOpsGetNormalCall srvMetadata let recvOps = serverOpsGetNormalCall srvMetadata
opResults <- U.runServerOps call serverCQ recvOps timeLimit call' = unServerCall call
opResults <- runOps call' serverCQ recvOps timeLimit
case opResults of case opResults of
Left x -> do grpcDebug "serverHandleNormalCall(U): ops failed; aborting" Left x -> do grpcDebug "serverHandleNormalCall(U): ops failed; aborting"
return $ Left x return $ Left x
@ -62,7 +62,7 @@ serverHandleNormalCall s@Server{..} timeLimit srvMetadata f = do
let status = C.GrpcStatusOk let status = C.GrpcStatusOk
let respOps = serverOpsSendNormalResponse let respOps = serverOpsSendNormalResponse
respBody respMetadata status details respBody respMetadata status details
respOpsResults <- U.runServerOps call serverCQ respOps timeLimit respOpsResults <- runOps call' serverCQ respOps timeLimit
case respOpsResults of case respOpsResults of
Left x -> do grpcDebug "serverHandleNormalCall(U): resp failed." Left x -> do grpcDebug "serverHandleNormalCall(U): resp failed."
return $ Left x return $ Left x