class ThreadsProcessingItem extends AbstractProcessingItem {

	public void processEvent(ContentEvent event, int counter) {
		if (this.piInstances == null || this.piInstances.size() < this.getParallelism())
			throw new IllegalStateException("ThreadsWorkerProcessingItem(s) need to be setup before process any event (i.e. in ThreadsTopology.start()).");
		
		ThreadsProcessingItemInstance piInstance = this.piInstances.get(counter);
		ThreadsEventRunnable runnable = new ThreadsEventRunnable(piInstance, event);
		ThreadsEngine.getThreadWithIndex(piInstance.getThreadIndex()).submit(runnable);
	}

	public  ThreadsProcessingItem(Processor processor, int parallelismHint);

}