package com.hammurapi.common.concurrent;

/**
 * Callback interface for tasks created by synapses.
 * Flow implementations provide implementation of this interface
 * for synchronization purposes, e.g. to wait for completion of all
 * flow tasks.
 * @author Pavel Vlasov
 */
public interface TaskCounter {

	/**
	 * Invoked when a new task has been created and about to
	 * be sent to execution.
	 * @param task
	 */
	void onTaskCreated(Runnable task);
	
	/**
	 * Invoked when a task finished execution.
	 * @param task
	 */
	void onTaskFinished(Runnable task);
}
