Recommended Python publish/subscribe/dispatch module? [closed]

PyDispatcher is used heavily in Django and it’s working perfectly for me (and for whole Django community, I guess). As I remember, there are some performance issues: Arguments checking made by PyDispatcher is slow. Unused connections have unnecessary overhead. AFAIK it’s very unlikely you will run into this issues in a small-to-medium sized application. So … Read more

Vanilla JS event delegation – dealing with child elements of the target element

Newer browsers Newer browsers support .matches: this.container.addEventListener(‘click’, function(e){ if (e.target.matches(‘#game-again,#game-again *’)) { e.stopPropagation(); self.publish(‘primo:evento’); } }); You can get the unprefixed version with var matches = document.body.matchesSelector || document.body.webkitMatchesSelector || document.body.mozMatchesSelector || document.body.msMatchesSelector || document.body.webkitMatchesSelector And then use .apply for more browsers (Still IE9+). Older browsers Assuming you have to support older browsers, you can … Read more

publishOn vs subscribeOn in Project Reactor 3

It took me sometime to understand it, maybe because publishOn is usually explained before subscribeOn, here’s a hopefully more simple layman explanation. subscribeOn means running the initial source emission e.g subscribe(), onSubscribe() and request() on a specified scheduler worker (other thread), and also the same for any subsequent operations like for example onNext/onError/onComplete, map etc … Read more

Redis + ActionController::Live threads not dying

A solution I just did (borrowing a lot from @teeg) which seems to work okay (haven’t failure tested it, tho) config/initializers/redis.rb $redis = Redis.new(:host => “xxxx.com”, :port => 6379) heartbeat_thread = Thread.new do while true $redis.publish(“heartbeat”,”thump”) sleep 30.seconds end end at_exit do # not sure this is needed, but just in case heartbeat_thread.kill $redis.quit end … Read more

How to reject topic subscription based on user rights with Spring-websocket

Thanks to Rossen Stoyanchev answer on github I was manage to solve this by adding interceptor to the inbound channel. Changes needed in the spring-websocket-portfolio demo application is the following: Change websocket configuration: public void configureClientInboundChannel(ChannelRegistration registration) { registration.setInterceptors(new TopicSubscriptionInterceptor()); } And the interceptor was something like this: public class TopicSubscriptionInterceptor extends ChannelInterceptorAdapter { private … Read more

Publishing/subscribing multiple subsets of the same server collection

Could you not just use the same query client-side when you want to look at the items? In a lib directory: enabledItems = function() { return Items.find({enabled: true}); } processedItems = function() { return Items.find({processed: true}); } On the server: Meteor.publish(‘enabled_items’, function() { return enabledItems(); }); Meteor.publish(‘processed_items’, function() { return processedItems(); }); On the client … Read more

What does Windows Service Bus add to MSMQ?

The main functional difference is Service Bus provides out of the box support for message exchange semantics such as topic based routing via publish-subscribe. MSMQ on the other hand is a lightweight store-and-forward queuing system, which supports point-to-point one way messaging. Service Bus: depends on SQL Server, and is a broker. This may be considered … Read more

tech