I want to create a queue which when filled up executes concurrently upto, say 3, items at most asynchronously.
I currently have the concurrency part sorted, but how do I an observable queue into which I can push observables and subscribe to the output.
Here's the code for static concurrency. This only lets 3 promises resolve at most at any time.
    import { defer, from } from 'rxjs';
    import { mergeAll } from 'rxjs/operators';
    async function getData(x: string) { // Returns original value after 1s
        return new Promise((resolve) => {
            setTimeout(() => resolve(x), 1000);
        });
    }
    const ids = [...Array(20).keys()]; // 1,2,3, ... 18,19,20
    const observables = ids.map((x) => defer(() => getData('John ' + x)));
    from(observables)
        .pipe(mergeAll(3))
        .subscribe((d) => {
            data.push({
                name: d as string
            });
        });
    let data = [
        {
            name: 'Jon start'
        }
    ];
