diesieben07
11/17/2020, 6:21 PMshareIn
. However this does not support a finite flow, as shareIn
makes the flow endless ("Shared flow never completes"). How can the collectors of the shared flow ever complete? Even if the original flow completes, they will continue to "hang", expecting more elements, because the shared flow never completes.Zach Klippenstein (he/him) [MOD]
11/17/2020, 6:26 PMlouiscad
11/17/2020, 6:30 PMfilterNotNull
to get back the non null type.diesieben07
11/17/2020, 6:31 PMval shared = data.onCompletion<ByteBuffer?> { emit(null) }
.shareIn(this, sharingStartedAfter(delegates.size))
.takeWhile { it != null }
.filterNotNull()