Gets a registered task that may have been registered through register.
the task
the index of the registered task