Tornado 6.5 Documentation
tornado.tcpserver — Basic IOStream-based TCP server Coroutines and concurrency tornado.gen — Generator-based coroutines tornado.locks – Synchronization primitives tornado.queues – Queues for coroutines divided into three major components: A web framework (including RequestHandler which is subclassed to create web applications, and various supporting classes). Client- and server-side implementions of HTTP yield is a generator. All generators are asynchronous; when called they return a generator object instead of running to completion. The @gen.coroutine decorator communicates with the generator via the yield0 码力 | 437 页 | 405.14 KB | 2 月前3Tornado 6.5 Documentation
into three major components: • A web framework (including RequestHandler which is subclassed to create web applications, and various supporting classes). • Client- and server-side implementions of HTTP yield is a generator. All generators are asynchronous; when called they return a generator object instead of running to completion. The @gen.coroutine decorator communicates with the generator via the yield decorator receives a Future from the generator, waits (without blocking) for that Future to complete, then “un- wraps” the Future and sends the result back into the generator as the result of the yield expression0 码力 | 272 页 | 1.12 MB | 2 月前3Rust 程序设计语言 简体中文版 1.85.0
=> file, Err(error) => match error.kind() { ErrorKind::NotFound => match File::create("hello.txt") { Ok(fc) => fc, Err(e) => panic!("Problem creating the match。 我们希望在内层 match 中检查的条件是 error.kind() 的返回值是否为 ErrorKind的 NotFound 变体。如果是,则通过 File::create 尝试创建该文件。然而因为 File::create 也可能会失 败,还需要在内层 match 表达式中增加了第二个分支。当文件不能被创建,会打印出一个不同 的错误信息。外层 match 的最后一个分支保持不变,这样对任何除了文件不存在的错误会使程 txt").unwrap_or_else(|error| { if error.kind() == ErrorKind::NotFound { File::create("hello.txt").unwrap_or_else(|error| { panic!("Problem creating the file: {error:0 码力 | 562 页 | 3.23 MB | 9 天前3
共 3 条
- 1