publish-subscribe

How to design publish-subscribe pattern properly in grpc?

本小妞迷上赌 提交于 2020-01-13 11:33:08
问题 i'm trying to implement pub sub pattern using grpc but i'm confusing a bit about how to do it properly. my proto: rpc call (google.protobuf.Empty) returns (stream Data); client: asynStub.call(Empty.getDefaultInstance(), new StreamObserver<Data>() { @Override public void onNext(Data value) { // process a data @Override public void onError(Throwable t) { } @Override public void onCompleted() { } }); } catch (StatusRuntimeException e) { LOG.warn("RPC failed: {}", e.getStatus()); } Thread

How can a Phoenix application tailored only to use channels scale on multiple machines? Using HAProxy? How to broadcast messages to all nodes?

只谈情不闲聊 提交于 2020-01-12 05:24:06
问题 I use the node application purely for socket.io channels with Redis PubSub, and at the moment I have it spread across 3 machines, backed by nginx load balancing on one of the machines. I want to replace this node application with a Phoenix application, and I'm still all new to the erlang/Elixir world so I still haven't figured out how a single Phoenix application can span on more than one machine. Googling all possible scaling and load balancing terms yielded nothing. The 1.0 release notes

How can a Phoenix application tailored only to use channels scale on multiple machines? Using HAProxy? How to broadcast messages to all nodes?

让人想犯罪 __ 提交于 2020-01-12 05:23:10
问题 I use the node application purely for socket.io channels with Redis PubSub, and at the moment I have it spread across 3 machines, backed by nginx load balancing on one of the machines. I want to replace this node application with a Phoenix application, and I'm still all new to the erlang/Elixir world so I still haven't figured out how a single Phoenix application can span on more than one machine. Googling all possible scaling and load balancing terms yielded nothing. The 1.0 release notes

Django/gevent socket.IO with redis pubsub. Where do I put things?

前提是你 提交于 2020-01-12 04:00:08
问题 I have an isolated python script that simply captures data from Twitter's streaming API and then on the receipt of each message, using redis pubsub it publishes to the channel "tweets". Here is that script: def main(): username = "username" password = "password" track_list = ["apple", "microsoft", "google"] with tweetstream.FilterStream(username, password, track=track_list) as stream: for tweet in stream: text = tweet["text"] user = tweet["user"]["screen_name"] message = {"text": text, "user"

Faye or Redis Pubsub

喜夏-厌秋 提交于 2020-01-11 17:24:11
问题 I thought I understood this technology, but maybe I don't. What's the difference between the two? Why would you choose one over the other? Usecase: ~Realtime updates. 回答1: I'm the author of Faye. Conceptually, Faye and Redis pub/sub do very similar things, indeed the latest release of Faye can use Redis as a back-end. As Tom says, Redis is appropriate for inter-process messaging within your server cluster since the Redis client will get access to your whole Redis database. Faye is more

Node.js, Socket.io, Redis pub/sub high volume, low latency difficulties

徘徊边缘 提交于 2020-01-10 06:15:07
问题 When conjoining socket.io/node.js and redis pub/sub in an attempt to create a real-time web broadcast system driven by server events that can handle multiple transports, there seems to be three approaches: 'createClient' a redis connection and subscribe to channel(s). On socket.io client connection, join the client into a socket.io room. In the redis.on("message", ...) event, call io.sockets.in(room).emit("event", data) to distribute to all clients in the relevant room. Like How to reuse

Node.js, Socket.io, Redis pub/sub high volume, low latency difficulties

心不动则不痛 提交于 2020-01-10 06:15:02
问题 When conjoining socket.io/node.js and redis pub/sub in an attempt to create a real-time web broadcast system driven by server events that can handle multiple transports, there seems to be three approaches: 'createClient' a redis connection and subscribe to channel(s). On socket.io client connection, join the client into a socket.io room. In the redis.on("message", ...) event, call io.sockets.in(room).emit("event", data) to distribute to all clients in the relevant room. Like How to reuse

Angularjs pubsub vs $broadcast

杀马特。学长 韩版系。学妹 提交于 2020-01-09 09:34:08
问题 I've been reading up on event passing in Angularjs and I'm not convinced that using $broadcast is a good idea. Blogs like this one advocate getting used to $on even though it "felt like overkill." My confusion is that the implementation uses a depth-first traversal of the scopes and looks for subscribers, which makes the speed of your events dependent on your tree structure. Here is some code from that in angular: // Insanity Warning: scope depth-first traversal // yes, this code is a bit

Angularjs pubsub vs $broadcast

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-09 09:32:18
问题 I've been reading up on event passing in Angularjs and I'm not convinced that using $broadcast is a good idea. Blogs like this one advocate getting used to $on even though it "felt like overkill." My confusion is that the implementation uses a depth-first traversal of the scopes and looks for subscribers, which makes the speed of your events dependent on your tree structure. Here is some code from that in angular: // Insanity Warning: scope depth-first traversal // yes, this code is a bit

Publish only things who were read 10seconds ago from now

十年热恋 提交于 2020-01-07 02:36:19
问题 I need to publish the stats from my CPU, Memory and other things that are stored in a collection. The things is it need to publish only the 10 last seconds from now. I join a picture to help the understanding of this: And I coded a function but the problem is that it doesn't remove the infos that are 11sec,12sec... older than now. Meteor.publish('dockerStats', function readInfosDockerStats(timeLimitSecond) { console.log(moment(new Date()).subtract(timeLimitSecond, 'second').toDate()) return