These may be used to construct complex pipeline networks. TeeConsumer objects split event flow so it goes to two two different consumers, one before the other. Java is not required on either end, and transport protocols other than HTTP may also be used. EventFilter objects selectively provide handling for callbacks, and can pass unhandled ones to a subsequent stage. They are often subclassed, since much of the basic filtering machinery is already in place in the base class.
Applications can merge two event flows by just using the same consumer in each one.
If multiple threads are in use, synchronization needs to be addressed by the appropriate application level policy. Terminus stages may have a public no-parameters constructor. It can sometimes be hard to see what's happening, when something goes wrong. Then you can find out where things start to go wrong. You can also use a DomConsumer to buffer the data, but remember that DOM doesn't save all the information that XML provides, so that DOM snapshots are relatively low fidelity.