Tornado 6.5 Documentation
require a long-lived connection to each user. Tornado can be roughly divided into three major components: • A web framework (including RequestHandler which is subclassed to create web applications, and library including the classes IOLoop and IOStream, which serve as the building blocks for the HTTP components and can also be used to implement other protocols. The Tornado web framework and HTTP server together in Tornado generally return placeholder objects (Futures), with the exception of some low- level components like the IOLoop that use callbacks. Futures are usually transformed into their result with the0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.5 Documentation
Coroutines Queue example - a concurrent web spider Structure of a Tornado web application Templates and UI Authentication and security Running and deploying Web framework tornado.web — RequestHandler and Error Handling Redirection Asynchronous handlers Templates and UI Configuring templates Template syntax Security Internationalization UI modules Authentication and security Cookies and signed cookies require a long-lived connection to each user. Tornado can be roughly divided into three major components: A web framework (including RequestHandler which is subclassed to create web applications, and0 码力 | 437 页 | 405.14 KB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
中,由于我们能比操作 系统在更细粒度上理解我们的程序,因此我们可以观察到很多操作系统无法察觉的并发机会。 例如,如果我们在构建一个管理文件下载的工具,我们应当以一种不会因开始一个下载任务而 锁定 UI 的方式来编写程序,并且用户应该能够同时开始多个下载任务。不过很多操作系统与 网络交互的 API 都是 阻塞 的(blocking)。也就是说这些 API 会阻塞程序的进程,直到它们处 理的数据完全就绪。 future 中,我们 await 这些信息,就像我们见过的其 它消息传递的示例那样。 为了回到本章开头提出的场景,想象一下用一个专门的线程来运行一系列视频解码任务(因为 视频解码是计算密集型任务)不过通知 UI 这些任务完成了是通过异步信道完成的。在现实世 界的用例中有无数这类组合的例子。 总结 这并不会是本书中你最后一次接触并发。第二一章 中的项目会在一个更加真实的场景中运用 这些概念,而不是这里讨 示例 18-4 定义了一个存放了名叫 components 的 vector 的结构体 Screen。这个 vector 的类 型是 Box,此为一个 trait 对象:它是 Box 中任何实现了 Draw trait 的类型的替身。 文件名:src/lib.rs pub struct Screen { pub components: Vec > 0 码力 | 562 页 | 3.23 MB | 10 天前3
共 3 条
- 1