History support
People asked pusher to make history. Its bad for user experience when you change page and loose message. Its cool to have "custom made" history for pusher. Any ideas?
My first thought would be that this could be an optional plugin?
I like how simple Poxa is. Just pull and fire it up, and it works great.
But this would add some form of data persistence... the slippery slope, haha!
@darrencauthon I think history should be short, like 5 last messages for 5 minutes. Also, mnesia is standart erlang/elixir library so its not a problem. I agree with you, it should be optional.
I will think on a sane way of having this, but I'm not sure if it's the case for Poxa. As @darrencauthon said if this could is done, it will be built on a way that is optional.
It's important to notice that It's not that it's not simply "use mnesia" because when we go distributed (and we are close to get there) this will be a problem as mnesia will not handle nicely a netsplit for example. Also other nuances that I don't even know as I never used mnesia for something that it wasn't an example code...
I would be glad to discuss some way of achieving this.
@edgurgel I think for netsplit, history can be lost, because its not sensitive data. Netsplits are rare so its not a problem. I have no experience with distributed mnesia, but it seems like a good candidate for me.
@edgurgel Also, there is an erlang project with history functionality and decent code https://github.com/doubleyou/dps
There are also concerns on how to give this history. This would need to be an extension to Pusher Protocol or some convention of event(s) that will happen when you subscribe.
As I know, pusher support user events, so it can be done with custom user event "history". Another option, is to use history option in config for each app id and send history after each user connection.
Second option is very arguable, but viable if first one is not easily available.
What do you think?