MCPcopy
hub / github.com/tornadoweb/tornado / instance

Method instance

tornado/ioloop.py:184–203  ·  view source on GitHub ↗

Deprecated alias for `IOLoop.current()`. .. versionchanged:: 5.0 Previously, this method returned a global singleton `IOLoop`, in contrast with the per-thread `IOLoop` returned by `current()`. In nearly all cases the two were the same (when they

()

Source from the content-addressed store, hash-verified

182
183 @staticmethod
184 def instance() -> "IOLoop":
185 """Deprecated alias for `IOLoop.current()`.
186
187 .. versionchanged:: 5.0
188
189 Previously, this method returned a global singleton
190 `IOLoop`, in contrast with the per-thread `IOLoop` returned
191 by `current()`. In nearly all cases the two were the same
192 (when they differed, it was generally used from non-Tornado
193 threads to communicate back to the main thread's `IOLoop`).
194 This distinction is not present in `asyncio`, so in order
195 to facilitate integration with that package `instance()`
196 was changed to be an alias to `current()`. Applications
197 using the cross-thread communications aspect of
198 `instance()` should instead set their own global variable
199 to point to the `IOLoop` they want to use.
200
201 .. deprecated:: 5.0
202 """
203 return IOLoop.current()
204
205 def install(self) -> None:
206 """Deprecated alias for `make_current()`.

Callers 4

run_testsFunction · 0.80
mainFunction · 0.80
server.pyFile · 0.80
test_resolvers.pyFile · 0.80

Calls 1

currentMethod · 0.80

Tested by

no test coverage detected