r4zzz4k
01/26/2018, 5:02 PMclass LoggingLinkedListChannel<E>(private val tag: String): LinkedListChannel<E>() {
override fun offerInternal(element: E): Any {
println("[$tag] $element")
return super.offerInternal(element)
}
}
val chan = LoggingLinkedListChannel<Int>("tag") // was Channel<Int>(Channel.UNLIMITED)
Is it even valid way to do this? It seems to be working for my simple use-case, but still.
As another way to do that was trying to get this working with .map { println(it); it }
, but it throws away capacity as it's effectively creates another channel.elizarov
01/26/2018, 6:59 PMr4zzz4k
01/26/2018, 7:00 PM