ru.hnau.jutils.producer.WrapProducer.kt Maven / Gradle / Ivy
package ru.hnau.jutils.producer
abstract class WrapProducer(
private val inProducer: Producer
) : Producer() {
abstract fun onWrappedProducerCall(data: I)
override fun onFirstAttached() {
super.onFirstAttached()
inProducer.attach(this::onWrappedProducerCall)
}
override fun onLastDetached() {
super.onLastDetached()
inProducer.detach(this::onWrappedProducerCall)
}
}