using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace PhoenixLib.Scheduler
{
///
/// This interface represents a task/job scheduler.
///
/// Type of the id that will be used to distinguish every job.
public interface IGenericJobPool
{
///
/// Enqueues a new job.
///
/// Method to call when the job is executed.
///
TId Enqueue(Expression method);
///
/// Enqueues a new job.
///
/// Method to call when the job is executed.
///
TId Enqueue(Expression> method);
///
/// Enqueues a new job.
///
///
/// Method to call when the job is executed.
///
TId Enqueue(Expression> method);
///
/// Enqueues a new job.
///
///
/// Method to call when the job is executed.
///
TId Enqueue(Expression>> method);
///
/// Creates a new job that will be enqueued after a given delay.
///
/// Method to call when the job is executed.
/// Delay before enqueuing the job.
///
TId Schedule(Expression method, TimeSpan delay);
///
/// Creates a new job that will be enqueued after a given delay.
///
/// Method to call when the job is executed.
/// Delay before enqueuing the job.
///
TId Schedule(Expression> method, TimeSpan delay);
///
/// Creates a new job that will be enqueued after a given delay.
///
/// Method to call when the job is executed.
/// Delay before enqueuing the job.
///
TId Schedule(Expression> method, TimeSpan delay);
///
/// Creates a new job that will be enqueued after a given delay.
///
/// Method to call when the job is executed.
/// Delay before enqueuing the job.
///
TId Schedule(Expression> method, TimeSpan delay);
///
/// Creates a new job that will be enqueued after a given delay.
///
/// Method to call when the job is executed.
/// Delay before enqueuing the job.
///
TId Schedule(Expression>> method, TimeSpan delay);
///
/// Creates a new job that will wait for parent job completion before to be enqueued.
///
/// Job id of the parent.
/// Method to call when the job is executed.
///
TId ContinueWith(TId parentJobId, Expression method);
///
/// Creates a new job that will wait for parent job completion before to be enqueued.
///
/// Job id of the parent.
/// Method to call when the job is executed.
///
TId ContinueWith(TId parentJobId, Expression> method);
///
/// Creates a new job that will wait for parent job completion before to be enqueued.
///
/// Job id of the parent.
/// Method to call when the job is executed.
///
TId ContinueWith(TId parentJobId, Expression> method);
///
/// Creates a new job that will wait for parent job completion before to be enqueued.
///
/// Job id of the parent.
/// Method to call when the job is executed.
///
TId ContinueWith(TId parentJobId, Expression>> method);
///
/// Deletes an existing job.
///
/// Id of the job.
void Remove(TId jobId);
}
}