Combining groupBy and flatMap(maxConcurrent, …) in RxJava/RxScala
问题 I have incoming processing requests, of which I want do not want too many processing concurrently due to depleting shared resources. I also would prefer requests which share some unique key to not be executed concurrently: def process(request: Request): Observable[Answer] = ??? requestsStream .groupBy(request => request.key) .flatMap(maxConcurrentProcessing, { case (key, requestsForKey) => requestsForKey .flatMap(1, process) }) However, the above doesn't work because the observable per key