Skip to content

Commit

Permalink
Merge pull request #1350 from benallard/patch-1
Browse files Browse the repository at this point in the history
Update styleguide about thd_ prefix for secondary-thread functions.
  • Loading branch information
Mikhail Sobolev committed Nov 14, 2014
2 parents d89a593 + 9b20440 commit aa8ab90
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions master/docs/developer/style.rst
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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.
To make this distinction clearer, every functions meant to be started in a secondary thread must be prefixed with ``thd_``.

0 comments on commit aa8ab90

Please sign in to comment.