简体   繁体   English

Zmq pub-sub 模式发布者是否需要在 n*O(m) 消息中多次上传给订阅者?

[英]Zmq pub-sub pattern does the publisher need to upload multiple times in n*O(m) messages to subscribers?

Hello all assuming that we have a pub-sub pattern in zmq with many subscribers, one publisher, and a message of 3GB.大家好,假设我们在 zmq 中有一个发布-订阅模式,有许多订阅者、一个发布者和一条 3GB 的消息。 My question is does the publisher send nx O(m) where n is the number of subscribers and m is the 3GB size or does it only uploads once the 3 GB and somehow the subscriber download it?我的问题是发布者是否发送 nx O(m),其中 n 是订阅者的数量,m 是 3GB 的大小,还是它只上传一次 3GB 并且订阅者以某种方式下载它? so to avoid the nx O(m).所以要避免 nx O(m)。

According to zmq docs pub-sub is a multicast pattern根据 zmq docs pub-sub 是一种多播模式

"ZeroMQ's low-level patterns have their different characters. Pub-sub addresses an old messaging problem, which is multicast or group messaging" “ZeroMQ 的低级模式有其不同的特征。Pub-sub 解决了一个古老的消息传递问题,即多播或群组消息传递”

so i expect not nx O(m) but just O(m) am i correct?所以我不希望 nx O(m) 而只是 O(m) 我是对的吗?

In general you only send once through the pub socket and it gets send to all subscribers.通常,您只通过 pub socket 发送一次,它就会发送给所有订阅者。

See docs here: https://zeromq.org/socket-api/#publish-subscribe-pattern请在此处查看文档: https://zeromq.org/socket-api/#publish-subscribe-pattern

PUB socket PUB插座

A PUB socket is used by a publisher to distribute data.发布者使用 PUB 套接字来分发数据。 Messages sent are distributed in a fan out fashion to all connected peers.发送的消息以扇出方式分发给所有连接的对等方。 This socket type is not able to receive any messages.此套接字类型无法接收任何消息。

When a PUB socket enters the mute state due to having reached the high water mark for a subscriber, then any messages that would be sent to the subscriber in question shall instead be dropped until the mute state ends.当 PUB 套接字由于达到订阅者的高水位线而进入静音 state 时,将丢弃任何发送给相关订阅者的消息,直到静音 state 结束。 The send function does never block for this socket type. send function 永远不会阻塞这种套接字类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM