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