waartaa / ircb

A versatile IRC bouncer for humans
MIT License
49 stars 15 forks source link

Realtime publishers #70

Closed rtnpro closed 8 years ago

rtnpro commented 8 years ago

This implements publishers from which we can subscribe to data (say, latest message logs in a channel) in realtime.

rtnpro commented 8 years ago

@pypingou Now, this is what I was talking about... realtime publishers

rtnpro commented 8 years ago

@sayanchowdhury see, if you can run ircb/publishers/__init__.py?

pypingou commented 8 years ago
+        self.results = deque(maxlen=self.limit)
+        self.index = {}

self.results is thus limited in size but self.index doesn't seem to be nor does it seem to be cleaned anywhere. Won't this end up being a memory leak or some sort?

rtnpro commented 8 years ago

@pypingou Yes, I know about the issue of self.index not getting cleaned. It seems like I have to do it manually everytime I add data to a queue which is full.

rtnpro commented 8 years ago

@pypingou Thanks for the review. I'd also like to know about your feedback on this concept of implementing a realtime publisher, powered by a dispatcher based store. That's what I meant when I said I was inspired by meteor, flux, fedmsg, hehe :) It did not turn up to be that ugly. What I am trying to get at is come up with a design pattern to make realtime stores, and in the long run, we can make it a standalone library, if we succeed with it in waartaa/ircb.

rtnpro commented 8 years ago

Thanks, @pypingou for the review. I have fixed all the issues you pointed out. Merging it.