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

Extract public 'dispatch' method from task_sent #427

Merged
merged 3 commits into from
Jul 16, 2021

Conversation

mdickinson
Copy link
Member

This PR addresses part of #354. (No, really!)

The "Creating your own background task type" portion of the docs discusses the _task_sent method, which is private and undocumented, and so we got Sphinx warnings as a result.

This PR extracts the part of that method that needs to be public into a new public BaseFuture.dispatch method, and updates the docs accordingly.

One benefit is that the dispatch method is now the only part of BaseFuture that assumes that messages have the form (message_type, message_arg), so it's the only part of BaseFuture that needs to be overridden if that assumption isn't convenient.

With this, we're down to 4 Sphinx warnings, all of which are about the GuiTestAssistant.

@@ -27,7 +27,7 @@ class IFuture(Interface):
#: The state of the background task, to the best of the knowledge of
#: this future. One of the six constants ``WAITING``, ``EXECUTING``,
#: ``COMPLETED``, ``FAILED``, ``CANCELLING`` or ``CANCELLED``.
state = FutureState
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh. Sorry, this was an unrelated fix; let me pull it into a separate PR.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mdickinson mdickinson merged commit b437bad into main Jul 16, 2021
@mdickinson mdickinson deleted the refactor/rename-task-sent-and-make-public branch July 16, 2021 15:46
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

Successfully merging this pull request may close these issues.

2 participants