Remove run_on_reactor (#3395)

This commit is contained in:
Amber Brown 2018-06-14 18:27:37 +10:00 committed by GitHub
parent 3681437c35
commit a61738b316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 6 additions and 63 deletions

View file

@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from twisted.internet import defer, reactor
from twisted.internet.defer import CancelledError
from twisted.python import failure
@ -41,13 +40,6 @@ def sleep(seconds):
defer.returnValue(res)
def run_on_reactor():
""" This will cause the rest of the function to be invoked upon the next
iteration of the main loop
"""
return sleep(0)
class ObservableDeferred(object):
"""Wraps a deferred object so that we can add observer deferreds. These
observer deferreds do not affect the callback chain of the original
@ -227,7 +219,7 @@ class Linearizer(object):
# the context manager, but it needs to happen while we hold the
# lock, and the context manager's exit code must be synchronous,
# so actually this is the only sensible place.
yield run_on_reactor()
yield sleep(0)
else:
logger.info("Acquired uncontended linearizer lock %r for key %r",