commonMain.it.unibo.tuprolog.solve.channel.impl.InputChannelFromFunction.kt Maven / Gradle / Ivy
package it.unibo.tuprolog.solve.channel.impl
import it.unibo.tuprolog.utils.synchronizedOnSelf
internal class InputChannelFromFunction(
private val generator: () -> T?,
private val availabilityChecker: () -> Boolean,
) : AbstractInputChannel() {
override val available: Boolean
get() = synchronizedOnSelf { availabilityChecker() }
override fun readActually(): T? = generator()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy