Media / foldkit-media/server
limitTransforms
function · packages/media/src/server/services.ts:73
function limitTransforms(
concurrency: number,
): <E, R>(
transformer: Layer.Layer<Transformer, E, R>,
) => Layer.Layer<Transformer, E, R>A Transformer that runs at most concurrency transforms at once, the
rest waiting their turn: encoding is CPU work, and a burst of misses should
queue, not starve every other request. For a transformer that encodes in
this process (sharp, WebAssembly); a host's binding does the work elsewhere.