public class BlackHoleChannelInt extends java.lang.Object implements ChannelOutputInt
ChannelOutputInt
with black hole semantics.
ChannelOutputInt
that yields
black hole semantics for a channel. Writers may always write but there can be
no readers. Any number of writers may share the same black hole.
Note: BlackHoleChannelInts are used for masking off unwanted outputs from processes. They are useful when we want to reuse an existing process component intact, but don't need some of its output channels (i.e. we don't want to redesign and reimplement the component to remove the redundant channels). Normal channels cannot be plugged in and left dangling as this may deadlock (parts of) the component being reused.
ChannelOutputInt
,
One2OneChannelInt
,
Any2OneChannelInt
,
One2AnyChannelInt
,
Any2AnyChannelInt
Constructor and Description |
---|
BlackHoleChannelInt() |
Modifier and Type | Method and Description |
---|---|
void |
poison(int strength)
This injects poison into the channel.
|
void |
write(int n)
Write an integer to the channel and loose it.
|
public void write(int n)
write
in interface ChannelOutputInt
n
- the integer to write to the channel.public void poison(int strength)
Poisonable
poison
in interface Poisonable
strength
- the strength of the poison (must be >= 0).Copyright © 1996–2024. All rights reserved.