From acefc35b8fa9ec5d8e7d2be88521921957f712f2 Mon Sep 17 00:00:00 2001 From: Joel Stanley Date: Wed, 8 Jun 2016 15:53:09 -0500 Subject: [PATCH] Oops: remove runServerOps, -Network.GRPC.LowLevel.Op.Unregistered module as it is no longer needed --- grpc-haskell.cabal | 1 - src/Network/GRPC/LowLevel/Op/Unregistered.hs | 13 ------------- src/Network/GRPC/LowLevel/Server/Unregistered.hs | 12 ++++++------ 3 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 src/Network/GRPC/LowLevel/Op/Unregistered.hs diff --git a/grpc-haskell.cabal b/grpc-haskell.cabal index a94fb86..2522f79 100644 --- a/grpc-haskell.cabal +++ b/grpc-haskell.cabal @@ -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 diff --git a/src/Network/GRPC/LowLevel/Op/Unregistered.hs b/src/Network/GRPC/LowLevel/Op/Unregistered.hs deleted file mode 100644 index 55b4077..0000000 --- a/src/Network/GRPC/LowLevel/Op/Unregistered.hs +++ /dev/null @@ -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 diff --git a/src/Network/GRPC/LowLevel/Server/Unregistered.hs b/src/Network/GRPC/LowLevel/Server/Unregistered.hs index 4069a01..e513bac 100644 --- a/src/Network/GRPC/LowLevel/Server/Unregistered.hs +++ b/src/Network/GRPC/LowLevel/Server/Unregistered.hs @@ -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