Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package divconq.io.stream;
 
 
 abstract public class BaseStream extends RecordStruct implements IStream {
 	protected IStream upstream = null;
 	protected IStream downstream = null;
 	
	public void setUpstream(IStream upstream) {
		this. = upstream;
		upstream.setDownstream(this);
	}
	public void setDownstream(IStream downstream) {
		this. = downstream;
	}

A message was sent from upstream to me.

Parameters:
msg data to process
Returns:
AWAIT if you are processing this async
	abstract public HandleReturn handle(TaskRun cbStreamMessage msg);

A cancel was sent from upstream to me.
	/*
	public void cancel(TaskRun cb) {
		if (this.downstream != null)
			this.downstream.cancel(cb);
	}
	*/

downstream is requesting that you send more messages
	abstract public void request(TaskRun cb);
	public IStreamSource getOrigin() {
		if (this instanceof IStreamSource)
			return (IStreamSourcethis;
		if (this. != null)
			return this..getOrigin();
		return null;
	}
	public void cleanup(TaskRun cb) {
		IStream up = this.;
		if (up != null)
			up.cleanup(cb);
		this.close();
	}
	public void close() {
		this. = null;
		this. = null;
	}
New to GrepCode? Check out our FAQ X