withThriftChannels :: CloseHandleAction -> Config -> (Channels -> IO result) -> IO result
withThriftChannels closeAction (host, port) action = do
  handle <- openHandle host port
  res <- action (BinaryProtocol handle, BinaryProtocol handle)
  closeAction handle
  return res
withThriftChannels :: CloseHandleAction -> Config -> (Channels -> IO result) -> IO result
withThriftChannels closeAction (host, port) action = do
  handle <- openHandle host port
  res <- action (BinaryProtocol handle, BinaryProtocol handle)
  closeAction handle
  return res
withThriftChannels closeAction (host, port) action = do
  handle <- openHandle host port
  res <- action (BinaryProtocol handle, BinaryProtocol handle)
  closeAction handle
  return res