Akka Stream Java - 是否可以将未知数量的源合并为一个

Akka Stream Java - is it possible to merge unknown amount of sources into one

我有一个 Slick 源,可以生成多个源:

 Source myBigSource = Slick.source(slickSession, sqlQueryString,
     (SlickRow row) -> {
          return (Source)createNewSource(row, someContext);
     }
 );

如何将 createNewSource 生成的源合并为一个大源。

使用 flatMapConcat 或 flatMapMerge:

Source myBigSource = Slick.source(slickSession, sqlQueryString,
    (SlickRow row) -> {
        return (Source)createNewSource(row, someContext);
    }
).flatMapConcat((o) -> o);