001package com.identityworksllc.iiq.common.task;
002
003import com.identityworksllc.iiq.common.threads.SailPointWorker;
004
005/**
006 * A functional interface for generating a SailPointWorker from a given
007 * set of objects, a consumer for those objects, and a taskContext for
008 * doing updates.
009 *
010 * @param <T> the type of the object
011 */
012@FunctionalInterface
013public interface ThreadWorkerCreator<T> {
014    /**
015     * Creates a new worker which should be runnable in either a thread or a partition
016     * for the given list of objects.
017     *
018     * @param objects The objects in question
019     * @param consumer The private context consumer
020     * @param taskContext The task context
021     * @return The constructed worker
022     */
023    SailPointWorker createWorker(Iterable<T> objects, PrivateContextObjectConsumer<T> consumer, ThreadedTaskListener<T> taskContext);
024}