8 Matching Annotations
  1. Oct 2023
  2. Aug 2023
  3. May 2018
    1. Fanout: 相当于广播,producer 可把消息发送给多个 consumer,属于异步调用范畴,如下图

    2. Cast: 异步调用,producer 发送消息后继续执行后续步骤,consumer 接收处理消息,如下图。

    3. Call: 同步调用,但过程稍微复杂,producer 发送消息后立刻创建一个 direct consumer, 该 direct consumer 阻塞于接收返回值。对端的 consumer 接收并处理 producer 的消息后,创建一个 direct producer,它负责把处理结果发送给 direct consumer

    4. AMQP 是应用层协议,它在 client 和 server 端引入了消息中间件,解耦了 client 和 server 端,支持大规模下的消息通信

      AMQP 引入了消息中间件

      从RPC角度来看,Client端要远程调用Server端的函数

      从AMQP角度来看,Client要发起请求,产生请求消息,所以是Producer,Server端需要获取消息消费,才能进行相应的处理,所以是Consumer

    1. 你可以使用传入type=的方式来使用Opt类,或者直接使用其对应类型的子类例如StrOpt类,如果配置项值无法解析成对应类型,将会抛出一个ValueError错误
      common_opts = [
          cfg.Opt( 'bind_port',
                    type=PortType,
                    default=9292,
                    help='Port number to listen')
      ]
      ### 等价于
      common_opts = [
          cfg.PortOpt( 'bind_port',
                        default=9292,
                        help='Port number to listen')
      ]
      

    Tags

    Annotators

  4. Jun 2017