Implement (but not yet test) scheduler process queue function.