You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by GitBox <gi...@apache.org> on 2020/06/03 10:40:24 UTC

[GitHub] [thrift] phile314 commented on a change in pull request #2169: THRIFT-4731: Replace usage of deprecated network modules in haskell library

phile314 commented on a change in pull request #2169:
URL: https://github.com/apache/thrift/pull/2169#discussion_r434472569



##########
File path: lib/hs/src/Thrift/Server.hs
##########
@@ -42,25 +42,41 @@ runThreadedServer :: (Protocol i, Protocol o)
                   => (Socket -> IO (i, o))
                   -> h
                   -> (h -> (i, o) -> IO Bool)
-                  -> PortID
+                  -> Int
                   -> IO a
 runThreadedServer accepter hand proc_ port = do
-    socket <- listenOn port
-    acceptLoop (accepter socket) (proc_ hand)
+    let hints = defaultHints {

Review comment:
       This is basically copy-paste from the network library how-to on how to listen on a socket.

##########
File path: lib/hs/src/Thrift/Transport/Handle.hs
##########
@@ -62,17 +63,12 @@ instance Transport Handle where
     tWrite = LBS.hPut
     tFlush = hFlush
 
-
--- | Type class for all types that can open a Handle. This class is used to
--- replace tOpen in the Transport type class.
-class HandleSource s where

Review comment:
       This class does not look really useful. I have removed it, but kept a `hOpenSocket` function to make the common use case of connecting to a socket concise.

##########
File path: lib/hs/thrift.cabal
##########
@@ -32,19 +32,12 @@ License-File:   LICENSE
 Description:
   Haskell bindings for the Apache Thrift RPC system. Requires the use of the thrift code generator.
 
-flag network-uri
-   description: Get Network.URI from the network-uri package
-   default: True
-
 Library
   Hs-Source-Dirs:
     src
   Build-Depends:
-    base >= 4, base < 5, containers, ghc-prim, attoparsec, binary, bytestring >= 0.10, base64-bytestring, hashable, HTTP, text, hspec-core > 2.4.0, unordered-containers >= 0.2.6, vector >= 0.10.12.2, QuickCheck >= 2.8.2, split
-  if flag(network-uri)
-     build-depends: network-uri >= 2.6, network >= 2.6 && < 3.0
-  else
-     build-depends: network < 2.6

Review comment:
       The network/network-uri split has already been a few years in the past, so I think it is safe to drop that compatibility code.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org