annotate stubs/twisted/internet/defer.pyi @ 1863:0f0ff27e55a3

stubs, mostly autogen or empty Ignore-this: bc70818d2bc92bf022c65c3572b9775e
author Drew Perttula <drewp@bigasterisk.com>
date Sat, 25 May 2019 12:01:26 +0000
parents
children 4ce991cdacdb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1863
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
1 # Stubs for twisted.internet.defer (Python 3)
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
2 #
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
3 # NOTE: This dynamically typed stub was automatically generated by stubgen.
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
4
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
5 from twisted.python import lockfile
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
6 from typing import Any, Callable, Generic, Optional, TypeVar
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
7
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
8 class AlreadyCalledError(Exception): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
9 class CancelledError(Exception): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
10 class TimeoutError(Exception): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
11
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
12 def succeed(result: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
13 def fail(result: Optional[Any] = ...): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
14 def maybeDeferred(f: Any, *args: Any, **kw: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
15
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
16 T = TypeVar('T')
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
17 class Deferred(Generic[T]):
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
18 called: bool = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
19 paused: bool = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
20 debug: bool = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
21 callbacks: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
22 def __init__(self, canceller: Optional[Any] = ...) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
23 def addCallbacks(self,
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
24 callback: Callable[[T], Any],
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
25 errback: Optional[Any] = ...,
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
26 callbackArgs: Optional[Any] = ...,
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
27 callbackKeywords: Optional[Any] = ...,
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
28 errbackArgs: Optional[Any] = ...,
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
29 errbackKeywords: Optional[Any] = ...): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
30 def addCallback(self, callback: Callable[[T], Any], *args: Any, **kw: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
31 def addErrback(self, errback: Any, *args: Any, **kw: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
32 def addBoth(self, callback: Callable[[T], Any], *args: Any, **kw: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
33 def addTimeout(self, timeout: Any, clock: Any, onTimeoutCancel: Optional[Any] = ...): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
34 def chainDeferred(self, d: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
35 def callback(self, result: T) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
36 def errback(self, fail: Optional[Any] = ...) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
37 def pause(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
38 def unpause(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
39 def cancel(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
40 def __iter__(self): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
41 def send(self, value: Optional[Any] = ...): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
42 __await__: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
43 __next__: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
44 def asFuture(self, loop: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
45 @classmethod
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
46 def fromFuture(cls, future: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
47
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
48 def ensureDeferred(coro: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
49
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
50 class DebugInfo:
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
51 failResult: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
52 def __del__(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
53
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
54 class FirstError(Exception):
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
55 subFailure: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
56 index: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
57 def __init__(self, failure: Any, index: Any) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
58 def __cmp__(self, other: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
59
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
60 class DeferredList(Deferred):
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
61 fireOnOneCallback: bool = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
62 fireOnOneErrback: bool = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
63 resultList: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
64 consumeErrors: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
65 finishedCount: int = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
66 def __init__(self, deferredList: Any, fireOnOneCallback: bool = ..., fireOnOneErrback: bool = ..., consumeErrors: bool = ...) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
67 def cancel(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
68
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
69 def gatherResults(deferredList: Any, consumeErrors: bool = ...): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
70
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
71 SUCCESS: bool
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
72 FAILURE: bool
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
73
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
74 class waitForDeferred:
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
75 d: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
76 def __init__(self, d: Any) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
77 def getResult(self): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
78
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
79 def deferredGenerator(f: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
80
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
81 class _DefGen_Return(BaseException):
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
82 value: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
83 def __init__(self, value: Any) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
84
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
85 def returnValue(val: Any) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
86
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
87 class _InternalInlineCallbacksCancelledError(Exception): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
88
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
89 def inlineCallbacks(f: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
90
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
91 class _ConcurrencyPrimitive:
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
92 waiting: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
93 def __init__(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
94 def run(*args: Any, **kwargs: Any): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
95
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
96 class DeferredLock(_ConcurrencyPrimitive):
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
97 locked: bool = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
98 def acquire(self): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
99 def release(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
100
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
101 class DeferredSemaphore(_ConcurrencyPrimitive):
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
102 tokens: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
103 limit: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
104 def __init__(self, tokens: Any) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
105 def acquire(self): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
106 def release(self) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
107
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
108 class QueueOverflow(Exception): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
109 class QueueUnderflow(Exception): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
110
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
111 class DeferredQueue:
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
112 waiting: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
113 pending: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
114 size: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
115 backlog: Any = ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
116 def __init__(self, size: Optional[Any] = ..., backlog: Optional[Any] = ...) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
117 def put(self, obj: Any) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
118 def get(self): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
119
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
120 class AlreadyTryingToLockError(Exception): ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
121
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
122 class DeferredFilesystemLock(lockfile.FilesystemLock):
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
123 def __init__(self, name: Any, scheduler: Optional[Any] = ...) -> None: ...
0f0ff27e55a3 stubs, mostly autogen or empty
Drew Perttula <drewp@bigasterisk.com>
parents:
diff changeset
124 def deferUntilLocked(self, timeout: Optional[Any] = ...): ...