Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: third_party/twisted_8_1/twisted/python/timeoutqueue.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/python/timeoutqueue.py
diff --git a/third_party/twisted_8_1/twisted/python/timeoutqueue.py b/third_party/twisted_8_1/twisted/python/timeoutqueue.py
deleted file mode 100644
index 9252dc312011f53794b1ce5724250bd3fb01f2b2..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/python/timeoutqueue.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- test-case-name: twisted.test.test_timeoutqueue -*-
-# Copyright (c) 2001-2007 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-"""
-A Queue subclass that supports timeouts.
-"""
-
-# System Imports
-import Queue, time, warnings
-
-
-_time = time.time
-_sleep = time.sleep
-
-
-class TimedOut(Exception):
- pass
-
-
-class TimeoutQueue(Queue.Queue):
- """
- A thread-safe queue that supports timeouts.
- """
-
- def __init__(self, max=0):
- warnings.warn("timeoutqueue is deprecated since Twisted 8.0",
- category=DeprecationWarning, stacklevel=2)
- Queue.Queue.__init__(self, max)
-
- def wait(self, timeout):
- """
- Wait until the queue isn't empty. Raises TimedOut if still empty.
- """
- endtime = _time() + timeout
- delay = 0.0005 # 500 us -> initial delay of 1 ms
- while 1:
- gotit = not self.empty()
- if gotit:
- break
- remaining = endtime - _time()
- if remaining <= 0:
- raise TimedOut, "timed out."
- delay = min(delay * 2, remaining, .05)
- _sleep(delay)
-
-
-__all__ = ["TimeoutQueue", "TimedOut"]
-
« no previous file with comments | « third_party/twisted_8_1/twisted/python/threadpool.py ('k') | third_party/twisted_8_1/twisted/python/urlpath.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698