publish-subscribe

Redis Pub/Sub ServiceStack, cancelling the thread

时光总嘲笑我的痴心妄想 提交于 2019-12-22 05:25:09
问题 This maybe a more general threading question i'm not sure. But I've got a WPF app that subscribes to channels and listens for messages from a redis database. App.SubscriptionThread = new Thread(() => { _redisSubscription.SubscribeToChannels("ChannelA", "ChannelB"); }); App.SubscriptionThread.Start(); Once I start this I have no idea how to stop it. Things I've tried. Using the Thread.Abort . This apparently doesn't stop it, as the thread just goes into a hang then forever (no unsubscription

.NET Scalable Pub/Sub service implementation

佐手、 提交于 2019-12-21 21:26:18
问题 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

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

混江龙づ霸主 提交于 2019-12-21 21:20:37
问题 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,

RSS: refresh rate?

混江龙づ霸主 提交于 2019-12-21 10:54:40
问题 I'm writing a little application for my own use which will consume a publicly published RSS feed. As far as I can tell, there's no subscribe/post mechanism in the protocol; I need to have my application HTTP-GET the RSS feed periodically. If that's the case, I'd like to grab it every ten minutes or so, but I'm worried about being seen as an abuser. I'd certainly be concerned if I saw someone poking my server every ten minutes for weeks on end. Is this a valid concern? Is there any general

Why can't I have a single Redis client acting as PUB and Sub in the same connection?

风流意气都作罢 提交于 2019-12-21 04:59:29
问题 My mental model was that of a 'chat', where I am subscribed to a certain channel and I can publish messages to this channel. 回答1: Since pub/sub is asynchronous, the published message could appear at any time, including when you are expecting the response to a command. Although redis is single threaded, which normally prevents that sort of thing, network latency can cause some interesting effects - depending on the content of the messages, you could receive a valid response to a command before

Redis Pub Sub channel memory

此生再无相见时 提交于 2019-12-21 04:12:14
问题 What mechanism(s) does Redis use to keep messages in memory in case of pub-sub ? If no client is subscribed what happens to the messages? Will Redis buffer them ? Is there a way to configure the min. and max. memory allocated per channel ? 回答1: Redis does not keep messages in memory in the Pub/Sub context as you can see in the implementation (x): the message is sent to clients listening for that channel (if any), the message is sent to clients listening to matching channels (if any). Then

What is the proper way to handle Redis connection in Tornado ? (Async - Pub/Sub)

不羁的心 提交于 2019-12-20 14:42:30
问题 I am using Redis along with my Tornado application with asyc client Brukva, when I looked at the sample apps at Brukva site they are making new connection on " init " method in websocket class MessagesCatcher(tornado.websocket.WebSocketHandler): def __init__(self, *args, **kwargs): super(MessagesCatcher, self).__init__(*args, **kwargs) self.client = brukva.Client() self.client.connect() self.client.subscribe('test_channel') def open(self): self.client.listen(self.on_message) def on_message

How to set up a minimal CKSubscription?

让人想犯罪 __ 提交于 2019-12-20 12:38:07
问题 I want to set up a simple CKSubscription that notifies me a recordType was created, how? 回答1: After experimenting a while this is how to setup a minimal CKSubscription. You have to test it on Device, push notification does not work on simulator. You can add record in Dashboard, that will trigger push notification too. func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { application.registerUserNotificationSettings

Re-queue message on exception

北城以北 提交于 2019-12-20 11:32:12
问题 I'm looking for a solid way of re-queuing messages that couldn't be handled properly - at this time. I've been looking at http://dotnetcodr.com/2014/06/16/rabbitmq-in-net-c-basic-error-handling-in-receiver/ and it seems that it's supported to requeue messages in the RabbitMQ API. else //reject the message but push back to queue for later re-try { Console.WriteLine("Rejecting message and putting it back to the queue: {0}", message); model.BasicReject(deliveryArguments.DeliveryTag, true); }

Php reading xml in post request

左心房为你撑大大i 提交于 2019-12-20 03:26:15
问题 So, I have perform two steps a) Create a some random xml file in one of the php file. b) Parse the same xml file in second file. Key points are that php file in a) will issue a post request to php file b) with only xml as its request. file b) will have to read the xml file using SImpleXml. I am trying to do something for this http://blog.superfeedr.com/API/pubsubhubbub/getting-started-with-pubsubhubbub/. I my server will be receiving notifications in form of xml from the the superfeeder. The