Package-level declarations

Types

Link copied to clipboard
abstract class AbstractChannel<T : Any> : Channel<T>

Base Channel implementation, thread-safely handling listener registration/notification, close/isClosed bookkeeping, and a unique id (used to build Channel.streamTerms), so that concrete channels only have to implement the actual I/O (see AbstractInputChannel/AbstractOutputChannel).

Link copied to clipboard
abstract class AbstractChannelStore<T : Any, C : Channel<T>, Self : ChannelStore<T, C, Self>>(channels: Map<String, C>) : ChannelStore<T, C, Self> , Map<String, C>

Base ChannelStore implementation, backing the map by an immutable channels and implementing ChannelStore.findByTerm/ChannelStore.aliasesOf plus equals/hashCode/toString in terms of it; concrete stores (it.unibo.tuprolog.solve.channel.InputStore/it.unibo.tuprolog.solve.channel.OutputStore implementations) only need to add their well-known channels on top.

Link copied to clipboard

Base InputChannel implementation, adding a one-element lookahead queue on top of AbstractChannel so that peek and isOver both work without consuming an element, while subclasses only need to implement the actual blocking read in readActually.

Link copied to clipboard

Base OutputChannel implementation, handling isClosed checks and listener notification around write/flush on top of AbstractChannel, so that subclasses only need to implement the actual transport writes in writeActually/flushActually.