Another possibility is to try as much as possible to push your I/O and flow control primitives to the edges of the program or library, providing integration points for multiple backends.
这是一种解耦方式,将和 IO 相关的控制代码局限在一个很小的范围内,这样可以适配多个后端,但是有一定的编写难度
Another possibility is to try as much as possible to push your I/O and flow control primitives to the edges of the program or library, providing integration points for multiple backends.
这是一种解耦方式,将和 IO 相关的控制代码局限在一个很小的范围内,这样可以适配多个后端,但是有一定的编写难度
In terms of receiving events, events can either be returned to the calling code immediately whenever bytes are provided, or they can be lazily produced in response to the calling code’s request.
接收有两种方式,直接返回和被调用时返回
it is usually important to preserve the datagram boundaries.
数据报文类型的协议,需要注意数据的边界
When it comes to network protocols, at a fundamental level they all consume and produce byte sequences.
协议的本质就是处理字节,从这里出发,来设计 no IO 的架构
This means that the core of the protocol implementation is divorced entirely from the way I/O is done or the way the API is designed.
明白来讲,就是将 IO 层和协议层解耦了,还是软件工程的解耦逻辑
because you have no mocking and no actual I/O
没有 mock 和 IO,让测试可以并发执行
there are far fewer possible entry points and locations in the state space.
更少的入口点,使得代码更容易测试
It is no secret that network I/O is particularly prone to a wide variety of unexpected failure modes that can occur at almost any time, even in the simplest cases.
无需考虑连接的错误
服务网格利用容器之间的网络设置来控制或改变应用程序中不同组件之间的交互。
服务网格:弹性化管理不同 service 之间的路由
ReplicationController
pod 的控制器
把一个 service 看成是一个 pod 的逻辑分组,它提供了一个单一的 IP 地址和 DNS 名称,你可以通过它访问服务内的所有 pod。
每一个 service 包含了一组 pod。service 是提供服务的独立单元。每个服务可能需要多个微服务 pod 的协作
与容器相关的一个重要概念是微服务。
容器里面就是微服务
Kubernetes 运行在节点 (node) 上,节点是集群中的单个机器。
节点:虚拟机或者物理机,
最重要的是你需要认识到 Kubernetes 利用了 “期望状态” 原则。
kube 中的配置文件,定义的是期望状态
你可以把容器看成是整个应用堆栈中的一层,每层都依赖于下层的单元。
“容器”这个词只是表示堆栈的“一层”,而不是像我们认为的那样,一个容器就表示一个可部署的 Image。