publish-subscribe

How to trigger an event across classes using delegates?

橙三吉。 提交于 2019-12-13 04:10:19
问题 I have 2 different classes and need to subscribe the event in main method.But I don't get subscribe the event in main method.Is any one know how to do it? First Class *********** public class Data { public string ID { get; set; } public string Description { get; set; } } public class ClsSub { public delegate void datahandler(Data dt); public event LogHandler OnDataRetrieved; public void LoadData() { DataTable dt = GetData(); Data logdata = new Data (); foreach (DataRow row in dt.Rows) { if

Handling concurrent connections in SiganlR

孤街浪徒 提交于 2019-12-13 02:38:25
问题 I am using .Net framework 4.5.2 and I will start to make a notification system that send notifications from web application into users that are connected from windows forms desktop application . after investigations i found that the suitable solution is using signalR as it supports filtering the notification before sending it to the connected clients . but my concern here is that : when i created my HUB class in the web application , i implemented the method OnConnected that will detect any

node.js redis server, what happens when there are multiple messages to the subscribed channel?

倾然丶 夕夏残阳落幕 提交于 2019-12-13 02:12:19
问题 Here's a puzzling problem for me. this node.js server subscribe and gets messages. Here's the code var subscriber = redis.createClient(port, host); var client = redis.createClient(port, host); var domain = require('domain'); var requirejs = require('requirejs'); var count = 0; requirejs(['my-generator'], function(MyGenerator) { subscriber.subscribe('CHANNEL'); subscriber.on('message', function(channel, message) { var data = JSON.parse(message); var key = data.key; var args = data.args; count

Does Kafka have Durable Subscriptions feature?

余生长醉 提交于 2019-12-13 01:25:24
问题 I'm interested to use Kafka in one of my projects, but there is a requirement that the messaging broker have to keep the the messages when one of the subscriber (consumer) is disconnected. I see that JMS have this feature. In the website it said that Kafka had durability features. Is it the same like JMS or is it have different meaning ? 回答1: Consumer pulls the data from kafka (brokers). Consumer specifies the offset from where it wants to gather the data. If Consumer disconnects and comes

Meteor: How to write a publish-function containing the username

…衆ロ難τιáo~ 提交于 2019-12-13 00:54:26
问题 Note: Whole code can be found here: https://github.com/Julian-Th/crowducate-platform/ Currently, all items from an array are displayed in one single list instead of a separate list tag: I have a pub function, which works perfectly: Meteor.publish('editableCourses', function () { return Courses.find({"canEditCourse": { $in: [ this.userId ] } }); }); However, I want to use the username instead. So I tried the following with no result: Meteor.publish('editableCourses', function () { return

Redis clients broadcast problems (in the context of Socket.IO)

这一生的挚爱 提交于 2019-12-12 20:23:20
问题 So I've read some articles about scaling Socket.IO. For various reasons I don't want to use built-in Socket.IO scaling mechanism (mostly it seems to be inefficient, since it publishes a lot more stuff to Redis then required from my point of view). So I've came up with this simple idea: Each Socket.IO server creates Redis pub/sub/store clients, connects to Redis and subscribes to a channel. Now, when I want to broadcast data I just publish it to Redis and all other Socket.IO servers get it and

Subscription manager doesn't update collection after new subscription

与世无争的帅哥 提交于 2019-12-12 20:13:57
问题 In my Meteor application I have this situation in which I have a 'Settings' collection only on the client. So the publish function is: Meteor.publish('settings', function (option) { this.added("settings", "settings", { bar: true, foo: { .... } }); this.ready(); }); Initially I subscribe like: waintOn: function () { return subs.subscribe('settings') } But when the route changes I subscribe again like return subs.subscribe('settings', 10); After this I see that the publish function runs, but on

EventBus on Android: how to implement dynamic queues vs. class-based event subscription?

强颜欢笑 提交于 2019-12-12 19:15:43
问题 I want to use EventBus (by Greenrobot, or any other) for the communication between the components of my Android application. In all the example, the pub/sub was implemented using a "class" as a "topic", i.e. each subscriber declares the exact class of events it should receive. I wonder if there is a more dynamic mechanism. Here is what I need to accomplish: my app needs to send commands (say, "Hello!") to multiple systems: 1, 2, ... N. The structure of the command is the same for all of them.

Real time chat in PHP +Redis +Pub/Sub +WebSockets (+NodeJS)

℡╲_俬逩灬. 提交于 2019-12-12 09:54:50
问题 I want to develop real time chat with channels and these are my needs: PHP backend to manage site Redis as session and data primary storage Pub/Sub to send messages only to channel's interested users one WebSocket connection with which the messages will be send and received. (optional) NodeJS to use great npm packages like timesync or socket.io I see two different architectures to achieve this: with Socket.io with Crossbar.io These are my questions: Which architecture I should choose and why?

Interprocess pubsub without network dependency

痴心易碎 提交于 2019-12-12 08:17:05
问题 Suppose I have no network card installed on my computer, and I would like to have functionality similar to the following: Process 1 will publish messages to some URI, say "Uri1" var publisher = new Publisher("Uri1"); publisher.publish(new Message("Somedata"); Process 2 will both listen for messages on "Uri1" and publish messages to "Uri2" var subscriber = new Subscriber("Uri1") subscriber.MessageReceived += data => Console.Writeline(data.ToString()); var publisher = new Publisher("Uri2")