Poll for a task

Polls for a task of the specified type. Used by workers to get tasks to execute. Returns a single task if available.