Tornado 6.5 Documentation
it is finished, and generally causes some work to happen in the background before triggering some future action in the application (as opposed to normal synchronous functions, which do every- thing they There are many styles of asynchronous interfaces: • Callback argument • Return a placeholder (Future, Promise, Deferred) • Deliver to a queue • Callback registry (e.g. POSIX signals) Regardless of tornado.concurrent import Future def async_fetch_manual(url): http_client = AsyncHTTPClient() my_future = Future() fetch_future = http_client.fetch(url) def on_fetch(f): my_future.set_result(f.result().body)0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
tornado.autoreload — Automatically detect code changes in development tornado.concurrent — Work with Future objects tornado.log — Logging support tornado.options — Command-line parsing tornado.testing — Unit it is finished, and generally causes some work to happen in the background before triggering some future action in the application (as opposed to normal synchronous functions, which do everything they are returning). There are many styles of asynchronous interfaces: Callback argument Return a placeholder (Future, Promise, Deferred) Deliver to a queue Callback registry (e.g. POSIX signals) Regardless of which0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414 17.6. future、任务和线程 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . await 关键字。 future 是一个现在可能还没有准备好但将在未来某个时刻准备好的值。(相同的概念也出现在 很多语言中,有时被称为 “task” 或者 “promise”。)Rust 提供了 Future trait 作为基础组件, 这样不同的异步操作就可以在不同的数据结构上实现。在 Rust 中,我们称实现了 Future trait 的类型为 future。每个 future 会维护自身的进度状态信息以及对 并恢复。在一个 async 块或 async 函数中,可以使用 await 关键字来 await 一个 future(即等待其就绪)。async 块或 async 函 数中每一个等待 future 的地方都可能是一个 async 块或 async 函数中断并随后恢复的点。检 查一个 future 并查看其值是否已经准备就绪的过程被称为 轮询(polling)。 其它一些语言,例如 C# 和 JavaScript,也使用0 码力 | 562 页 | 3.23 MB | 10 天前3
共 3 条
- 1