public abstract class CoroutineEnvironment
extends org.obrel.core.RelatedObject
channels for
the communication between coroutines. They allow to set relations for
coroutine configuration and/or state.| Constructor and Description |
|---|
CoroutineEnvironment() |
| Modifier and Type | Method and Description |
|---|---|
<T> Channel<T> |
createChannel(ChannelId<T> rId,
int nCapacity)
Creates a new channel with a certain capacity and stores it in this
context for lookup with
getChannel(ChannelId). |
<T> Channel<T> |
getChannel(ChannelId<T> rId)
Returns a channel for a certain ID.
|
boolean |
hasChannel(ChannelId<?> rId)
Checks whether this context contains a certain channel.
|
void |
removeChannel(ChannelId<?> rId)
Removes a channel from this context.
|
deleteRelation, get, getRelation, getRelations, notifyRelationListeners, readRelations, relationsEqual, relationsHashCode, relationsString, set, set, toString, transform, writeRelationspublic <T> Channel<T> createChannel(ChannelId<T> rId, int nCapacity)
getChannel(ChannelId). If a channel with
the given ID already exists an exception will be thrown to prevent
accidental overwriting of channels.rId - The channel IDnCapacity - The channel capacityjava.lang.IllegalArgumentException - If a channel with the given ID already
existspublic <T> Channel<T> getChannel(ChannelId<T> rId)
createChannel(ChannelId, int).rId - The channel IDpublic boolean hasChannel(ChannelId<?> rId)
rId - The channel IDpublic void removeChannel(ChannelId<?> rId)
rId - The channel ID