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

Update styleguide about thd_ prefix for secondary-thread functions. #1350

Merged
merged 2 commits into from
Nov 14, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions master/docs/developer/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,9 @@ use a `DeferredList <http://twistedmatrix.com/documents/current/api/twisted.inte
Here the deferred list will wait for both ``rev_parse_d`` and ``log_d`` to
fire, or for one of them to fail. You may attach callbacks and errbacks to a
``DeferredList`` just as for a deferred.

Functions running outside of the main-thread
Copy link
Contributor

Choose a reason for hiding this comment

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

main thread

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It is very important in Twisted to be able to distinguish functions that runs in the main-thread and functions that don't, as reactors and deferreds can only be used in the main thread.
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

To make this distinction clearer, every functions meant to be started in a secondary thread should be prefixed with ``thd_``.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/should/must/