Rust 程序设计语言 简体中文版 1.85.0你可以将编程中的信道想象为一个水流的渠道,比如河流或小溪。如果你将诸如橡皮鸭之类的 东西放入其中,它们会顺流而下到达下游。 信道有两个组成部分:一个发送端(transmitter)和一个接收端(receiver)。发送端位于上 游位置,在这里可以将橡皮鸭放入河中,接收端则位于下游,橡皮鸭最终会漂流至此。代码中 的一部分调用发送端的方法以及希望发送的数据,另一部分则检查接收端收到的消息。当发送 端或接 mpsc::channel 函数返回一个元组:第一个元素是发送侧 – 发送端,而第二个元素是接收侧 – 接收端。由于历史原因,tx 和 rx 通常作为发送端(transmitter)和 接收端(receiver)的传 统缩写,所以这就是我们将用来绑定这两端变量的名字。这里使用了一个 let 语句和模式来解 构了此元组;第十九章会讨论 let 语句中的模式和解构。现在只需知道使用 let 语句是一个 方便提取 可以发送端向接收端发送消息了。注意我们无需产生一个独立的线程或者任务;只需等待 (await) rx.recv 调用。 std::mpsc::channel 中的同步 Receiver::recv 方法阻塞执行直到它接收一个消息。 trpl::Receiver::recv 则不会阻塞,因为它是异步的。不同于阻塞,它将控制权交还给运行 时,直到接收到一个消息或者信道的发送端关闭。相比之下,我们不用 await send,因为它不0 码力 | 562 页 | 3.23 MB | 24 天前3
Tornado 6.5 Documentationcomfortably keep in memory see the stream_request_body class decorator. In the demos directory, file_receiver.py shows both methods of receiving file uploads. Due to the quirks of the HTML form encoding (e regular HTTP method (post, put, etc) will be called after the entire body has been read. See the file receiver demo for example usage. 6.2. Web framework 57Tornado Documentation, Release 6.5.1 Everything else0 码力 | 272 页 | 1.12 MB | 3 月前3
Tornado 6.5 Documentationcomfortably keep in memory see the stream_request_body class decorator.In the demos directory, file_receiver.py [https://github.com/tornadoweb/tornado/tree/stable/demos/file_upload/] shows both methods of regular HTTP method (post, put, etc) will be called after the entire body has been read. See the file receiver demo [https://github.com/tornadoweb/tornado/tree/stable/demos/file_upload/] for example usage.0 码力 | 437 页 | 405.14 KB | 3 月前3
julia 1.10.10the this keyword, rather than as an explicit method argument. When the current this object is the receiver of a method call, it can be omitted altogether, writing just meth(arg1,arg2), with this implied polymorphism (as opposed to Python method calls which use a different syntax and allows dispatch on the receiver of the method). • There are no classes in Julia. Instead there are structures (mutable or immutable)0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.10.9the this keyword, rather than as an explicit method argument. When the current this object is the receiver of a method call, it can be omitted altogether, writing just meth(arg1,arg2), with this implied polymorphism (as opposed to Python method calls which use a different syntax and allows dispatch on the receiver of the method). • There are no classes in Julia. Instead there are structures (mutable or immutable)0 码力 | 1692 页 | 6.34 MB | 3 月前3
Julia 1.11.4the this keyword, rather than as an explicit method argument. When the current this object is the receiver of a method call, it can be omitted altogether, writing just meth(arg1,arg2), with this implied polymorphism (as opposed to Python method calls which use a different syntax and allows dispatch on the receiver of the method). • There are no classes in Julia. Instead there are structures (mutable or immutable)0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.5 Documentationthe this keyword, rather than as an explicit method argument. When the current this object is the receiver of a method call, it can be omitted altogether, writing just meth(arg1,arg2), with this implied polymorphism (as opposed to Python method calls which use a different syntax and allows dispatch on the receiver of the method). • There are no classes in Julia. Instead there are structures (mutable or immutable)0 码力 | 2007 页 | 6.73 MB | 3 月前3
Julia 1.11.6 Release Notesthe this keyword, rather than as an explicit method argument. When the current this object is the receiver of a method call, it can be omitted altogether, writing just meth(arg1,arg2), with this implied polymorphism (as opposed to Python method calls which use a different syntax and allows dispatch on the receiver of the method). • There are no classes in Julia. Instead there are structures (mutable or immutable)0 码力 | 2007 页 | 6.73 MB | 3 月前3
julia 1.13.0 DEVthe this keyword, rather than as an explicit method argument. When the current this object is the receiver of a method call, it can be omitted altogether, writing just meth(arg1,arg2), with this implied polymorphism (as opposed to Python method calls which use a different syntax and allows dispatch on the receiver of the method). • There are no classes in Julia. Instead there are structures (mutable or immutable)0 码力 | 2058 页 | 7.45 MB | 3 月前3
Julia 1.12.0 RC1the this keyword, rather than as an explicit method argument. When the current this object is the receiver of a method call, it can be omitted altogether, writing just meth(arg1,arg2), with this implied polymorphism (as opposed to Python method calls which use a different syntax and allows dispatch on the receiver of the method). • There are no classes in Julia. Instead there are structures (mutable or immutable)0 码力 | 2057 页 | 7.44 MB | 3 月前3
共 13 条
- 1
- 2













