getJob :: Handle -> Pool -> IO ()
getJob h rpoo = do
  msgSize <- decode <$> B.hGet h 8
  case msgSize of
    Left _ -> return ()
    Right size -> do
      eej <- decode <$> B.hGet h size
      case eej of
        Left _ -> return ()
        Right j -> unless (broken j) $ do
          unique <- hashUnique <$> newUnique
          modifyMVar_ rpoo (return . M.insert unique j)
          B.hPut h (B.pack $ show unique)
  hClose h
getJob :: Handle -> Pool -> IO ()
getJob h rpoo = do
  msgSize <- decode <$> B.hGet h 8
  case msgSize of
    Left _ -> return ()
    Right size -> do
      eej <- decode <$> B.hGet h size
      case eej of
        Left _ -> return ()
        Right j -> unless (broken j) $ do
          unique <- hashUnique <$> newUnique
          modifyMVar_ rpoo (return . M.insert unique j)
          B.hPut h (B.pack $ show unique)
  hClose h
getJob h rpoo = do
  msgSize <- decode <$> B.hGet h 8
  case msgSize of
    Left _ -> return ()
    Right size -> do
      eej <- decode <$> B.hGet h size
      case eej of
        Left _ -> return ()
        Right j -> unless (broken j) $ do
          unique <- hashUnique <$> newUnique
          modifyMVar_ rpoo (return . M.insert unique j)
          B.hPut h (B.pack $ show unique)
  hClose h