publish-subscribe

Using blocking REST requests to implement publish/subscribe

纵然是瞬间 提交于 2019-12-05 03:14:10
I've recently been asked to investigate the feasibility of integrating with a phone system vendor who wants to make phone events (e.g. line ringing, extension answered, call cleared) available using a RESTful web service. I pointed out that REST is a request/response protocol and they were doing publish/subscribe. The solution they were suggesting was to make an HTTP REST request which would block and then eventually respond if and when an event was available - or time out. Either way, another request would be made to get the next event and so on ad infinitum. This idea made me cringe, but I

Difference between PubSub and Methods

感情迁移 提交于 2019-12-05 01:13:32
问题 What is the difference between PubSub and Methods in Meteor?! Can I put Methods in Server folder like Publishs? To me seen like the same, but Methods is more reactive. 回答1: They are two different sides of the same coin. Here's a drawing of the data lifecycle in meteor: Publish - Which data is sent from the server Subscribe - Which data the client requests publications for Methods - How to manipulate data from the client on the server Note - this will typically be run on both on the client and

Redis / Node.js - 2 clients (1 pub/sub) causing issues with writes

情到浓时终转凉″ 提交于 2019-12-05 00:33:06
问题 Trying to create two clients; one is pub/sub, the other is a standard connection. Is this not possible? There must be a way to abstract this to work :) Basically, if I do a get key after running test.js, all I see is 'valueBefore'. The output: node test.js Reply: OK /Users/franklovecchio/Desktop/development/node/node_modules/redis/index.js:487 throw new Error("Connection in pub/sub mode, only pub/sub commands may ^ Error: Connection in pub/sub mode, only pub/sub commands may be used at

OpenFire - Permanent Group Chat using PubSub

馋奶兔 提交于 2019-12-05 00:16:51
问题 First from this question : Asmack/openfire How do I keep a user permanently in groupchat room I read that I cannot use MUC to keep the user persistent in the group, they'll automatically leave the group and can rejoin after they come online again, that concept is like IRC like what've been asked in here -> http://community.igniterealtime.org/thread/48020. Then from the stackoverflow question I read about using pubsub, then I've done some research about pubsub and what I've got is pubsub can

Integrating JaxRS REST service with WebSockets

此生再无相见时 提交于 2019-12-04 20:51:53
I'm attempting to develop a social network that implements publisher-subscribe pattern (kind of like Twitter does): users can follow people, therefore being notified when a new publication of their followers is sent. All I have now is a working REST service implemented with JaxRS, running over Tomcat 7, offering services for login, register, getting profiles data and submitting posts. Servlet Mapping is done via web.xml My JaxRS app config RestServices Web.xml But the weight of the application comes from the pubsub part. And here is where things become messy. Before speaking of technologies

Rx how to create a sequence from a pub/sub pattern

倾然丶 夕夏残阳落幕 提交于 2019-12-04 20:35:23
I'm trying to evaluate using Rx to create a sequence from a pub/sub pattern (i.e. classic observer pattern where next element is published by the producer(s)). This is basically the same as .net events, except we need to generalize it such that having an event is not a requirement, so I'm not able to take advantage of Observable.FromEvent. I've played around with Observable.Create and Observable.Generate and find myself end up having to write code to take care of the pub/sub (i.e. I have to write producer/consumer code to stash the published item, then consume it by calling IObserver.OnNext()

Javascript pub/sub implementation works for functions, but not objects' methods

限于喜欢 提交于 2019-12-04 20:11:06
I'm trying to implement a simple Pub/Sub object in javascript, and here's my code: var PubSub=new function(){ this.subscriptions=[]; this.subscribe=function(topic,callback){ if(!this.subscriptions[topic]){ this.subscriptions[topic]=[]; } this.subscriptions[topic].push(callback); } this.unsubscribe=function(topic,callback){ if(this.subscriptions[topic]){ for(var i=this.subscriptions[topic].length-1;i>=0;i--){ if(this.subscriptions[topic][i]==callback){ this.subscriptions[topic].splice(i,1); } } } } this.publish=function(topic,data){ if(this.subscriptions[topic]){ for(var i=this.subscriptions

using WCF Callback and asp.net to implement publish/subscribe pattern

不羁的心 提交于 2019-12-04 19:56:15
This is my first web application with WCF. So please guide me as a new guy. I'm trying to use WCF Callback to implement publish/subscribe pattern. I would like to send the message from UserA to UserB or UserA to every client at the moment. I got an example from here . In my app, I use ASP.NET as a client to connect WCF service instead and I found a problem when I subscribe to WCF service. The WCF service does not hold any other clients object. So when I call GetAllClients(_guid) , it will return only 1 client which is itself. Here is the code in ASP.NET page (I put every control inside

.NET Scalable Pub/Sub service implementation

我的未来我决定 提交于 2019-12-04 17:17:24
I need to build a system that is similar to a pub/sub system. It is composed of multiple sub-systems or services running in separate executables or as a Windows Services. The sub-systems are: The pub/sub service A pub/sub service managing communications between the internal sub-systems and the users. A user can have multiple channels open (A web page connected to a SignalR service, a mobile device connected to a duplex WCF service, etc.). The service should manage all the channels of an user and be able to send information to them on demand based on topics or specific users. The service must

How to synchronize the publishers and subscribers in extended PUB-SUB pattern with Intermediary in ZeroMQ in c++?

℡╲_俬逩灬. 提交于 2019-12-04 16:26:41
Extended PUB/SUB topology I have multiple publishers and multiple subscribers in a use case with 1 intermediary. In the ZeroMQ guide, I learnt about synchronizing 1 publisher and 1 subscriber, using additional REQ/REP sockets. I tried to write a synchronization code for my use case, but it is getting messy if I try to write code according to logic given for 1-1 PUB/SUB . The publisher code when we have only 1 publisher is : //Socket to receive sync request zmq::socket_t syncservice (context, ZMQ_REP); syncservice.bind("tcp://*:5562"); // Get synchronization from subscribers int subscribers = 0