summaryrefslogtreecommitdiff
path: root/src/main/java/bjc/esodata/Spooler.java
blob: 2cf415a97d093895bc6b823df25cf7f953325d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package bjc.esodata;

import java.util.Iterator;
import java.util.function.Consumer;

/**
 * Represents a 'spool' facility for gathering batches of input together to be
 * processed.
 * 
 * @author bjcul
 *
 * @param <T> The type of data held in the spools
 */
public interface Spooler<T> {
	/**
	 * Register a pre-existing spool with this spooler.
	 * 
	 * @param spool The spool to register
	 */
	public void registerSpool(Spool<T> spool);
	
	/**
	 * Get a consumer belonging to a new anonymous spool.
	 * 
	 * @return A new anonymous spool.
	 */
	public Consumer<T> getInput();
	
	/**
	 * Get the output for a unprocessed spool.
	 * 
	 * @return The output for a unprocessed spool.
	 */
	public Iterator<T> getOutput();
	
	/**
	 * Get an unprocessed spool.
	 * 
	 * @return An unprocessed spool
	 */
	public Spool<T> getSpool();
}