Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation should explain what "closing" a job means #66

Open
gjcarneiro opened this issue Oct 18, 2018 · 1 comment
Open

Documentation should explain what "closing" a job means #66

gjcarneiro opened this issue Oct 18, 2018 · 1 comment

Comments

@gjcarneiro
Copy link

The documentation for Job.close() is very vague: https://aiojobs.readthedocs.io/en/stable/api.html#aiojobs.Job.close

coroutine close(*, timeout=None)
Close the job.

If timeout exceeded asyncio.TimeoutError raised.

The job is in closed state after finishing the method.

Yes, but what does "closing" a job really entail? I suspect cancellation via asyncio.Task.cancel(), but the only way of knowing is to read the source code.

(goes read the source)

Yes, indeed it does asyncio.Task.cancel(). That is good. But docs need to be more specific. Perhaps linking to the asyncio docs.

Suggestion of improved docstring:

Closes the job by means of requesting the underlying asyncio Task to be [cancelled](https://docs.python.org/3/library/asyncio-task.html#asyncio.Task.cancel).
@Dreamsorcerer
Copy link
Member

Happy to review a PR with a change to the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants