编码
mapConcurrently httpLBS requests
投掷
ConnectionFailure Network.BSD.getProtocolByName: does not exist (no such protocol name: tcp))
在大约 1k 个请求之后。
编码
mapConcurrently httpLBS requests
投掷
ConnectionFailure Network.BSD.getProtocolByName: does not exist (no such protocol name: tcp))
在大约 1k 个请求之后。
这些请求都是并行运行的,并使进程用完文件描述符。采用
import ClassyPrelude
traverseThrottled :: (MonadMask m, MonadBaseControl IO m, Forall (Pure m), Traversable t) => Int -> (a -> m b) -> t a -> m (t b)
traverseThrottled concLevel action taskContainer = do
sem <- newQSem concLevel
let throttledAction = bracket_ (waitQSem sem) (signalQSem sem) . action
mapConcurrently throttledAction taskContainer
(如果您不使用,请调整导入ClassyPrelude
)
httpLBS
如果您使用流式传输替代方案,请确保您的等价物使用该请求。而且你b
在所有领域都很严格。