1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to make one MergeMap Observable sequence to start a new one after one is completed?

Discussão em 'Angular' iniciado por rafaelpadu, Junho 24, 2025.

  1. rafaelpadu

    rafaelpadu Guest

    I need to upload a list of files while ensuring no more than 5 files are uploaded simultaneously.

    While my code already limits concurrent uploads to 5, it waits for all 5 files in a batch to finish before starting the next set.

    from(waitingFiles)
    .pipe(
    mergeMap((file: UploadQueue) => {
    return this.doUpload(file, documentId, documentVersion, saveDocument)
    }, batchQtnFiles),
    bufferCount(batchQtnFiles),
    tap(() => {
    this.updateQtyPending(saveDocument, documentId);
    })
    ).subscribe();


    Instead, I want it to immediately start the next file as soon as one upload finishes and always maintain the concurrency limit of 5 (no more than 5 active uploads at any time)

    Continue reading...

Compartilhe esta Página