Future это тип, для которого имплементирован трейт Future
Executor. Это может быть ивент-луп, тред пул или что-то еще.
| $ nix-shell https://github.com/NixOS/nixpkgs/archive/941b4b8f048a383366e24c12022e99c87db09db6.tar.gz -A python39Packages.twisted | |
| Sourcing python-remove-tests-dir-hook | |
| Sourcing python-catch-conflicts-hook.sh | |
| Sourcing python-remove-bin-bytecode-hook.sh | |
| Sourcing setuptools-build-hook | |
| Using setuptoolsBuildPhase | |
| Using setuptoolsShellHook | |
| Sourcing pip-install-hook | |
| Using pipInstallPhase | |
| Sourcing python-imports-check-hook.sh |
| { config, pkgs, ... }: | |
| { | |
| imports = | |
| [ | |
| ./hardware-configuration.nix | |
| ]; | |
| nixpkgs.config = { | |
| allowUnfree = true; | |
| packageOverrides = pkgs: { | |
| unstable = import <nixos-unstable> { |
| ``` | |
| #[derive(Debug, Clone, Copy, PartialOrd, Ord, PartialEq, Eq, Serialize, Deserialize, Hash)] | |
| pub struct Time { | |
| // utc timestamp | |
| timestamp: i64, | |
| // timezone offset | |
| offset: i32, | |
| } |
| $ cat test.go | |
| package main | |
| import "os/user" | |
| func main() { | |
| _, _ = user.Current() | |
| } | |
| $ go build test.go | |
| $ gdb ./test |
| struct FramedTransport<T, C> where T: AsyncRead + AsyncWrite + 'static { | |
| inner: length_delimited::Framed<T>, | |
| codec: C, | |
| } | |
| fn framed_delimited<T, C>(framed: length_delimited::Framed<T>, codec: C) -> FramedTransport<T, C> | |
| where T: AsyncRead + AsyncWrite, C: codec::Encoder + codec::Decoder | |
| { | |
| FramedTransport{ inner: framed, codec: codec } | |
| } |
| vendor_id : GenuineIntel | |
| cpu family : 6 | |
| model : 63 | |
| model name : Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz | |
| stepping : 2 | |
| microcode : 0x2e | |
| cpu MHz : 3040.039 | |
| cache size : 30720 KB | |
| physical id : 0 | |
| siblings : 24 |
| _____ _____ _____ | |
| /\ \ /\ \ /\ \ | |
| /::\____\ /::\____\ /::\ \ | |
| /:::/ / /:::/ / /::::\ \ | |
| /:::/ / /:::/ / /::::::\ \ | |
| /:::/ / /:::/ / /:::/\:::\ \ | |
| /:::/____/ /:::/ / /:::/__\:::\ \ | |
| /::::\ \ /:::/ / /::::\ \:::\ \ | |
| /::::::\ \ _____ /:::/ / _____ /::::::\ \:::\ \ | |
| /:::/\:::\ \ /\ \ /:::/____/ /\ \ /:::/\:::\ \:::\ ___\ |
| impl AmqpClient { | |
| fn call(&mut self, Request::Channel::Open) -> Future<Channel, AmqpError> | |
| } | |
| impl Channel { | |
| fn declare_queue(&mut self, name: AsRef<str>) -> Future<Queue, AmqpError> | |
| } | |
| impl Queue { | |
| fn consume(&mut self) -> Future<MessageStream, AmqpError> |
| [/tmp]% cat test.txt | |
| 0 | |
| [/tmp]% cat test.php | |
| <?php> | |
| $file = fopen("test.txt", "r"); | |
| $buf = ''; | |
| while ($buf = fread($file, 1)) { | |
| echo("inside\n"); | |
| } | |
| echo("outside\n"); |