Duppy.TaskCore task registration. * * A task will be a set of events to watch, and a corresponding function to * execute when one of the events is triggered. * * The executed function may then return a list of new tasks to schedule.
A task is a list of events awaited, * and a function to process events that have occurred. * * The 'a parameter is the type of priorities, 'b will be a subset of possible * events.
Type for possible events. * * Please not that currently, under win32, all socket used in ocaml-duppy * are expected to be in blocking mode only!
Schedule a task. With domain, only the worker on that domain runs it, and so does every task its handler returns. Raises Unknown_domain when no started worker is on that domain or accepts the task's priority, and always on a thread pool, where workers share a domain.