Closed (fixed)
Project:
Heartbeat
Version:
6.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
25 Feb 2010 at 05:00 UTC
Updated:
18 Jul 2010 at 21:40 UTC
I don't want to run a constant poll on the heartbeat block, it's expensive. I think it would be better (for me) if the pollling happens when users submit a new fb-style status message on the profile. This way people can see their new post.
Thanks!
Comments
Comment #1
Stalski commentedThe interval for polling can be disabled for a stream at /admin/build/heartbeat/streams and choose a stream. This configuration is for each stream.
When posting a shout, it's possible for heartbeat to hook into the after event in javascript and manually call the poll for newer messages, and that works. You will have to talk to the maintainer of facebook status for a after javascript event so heartbeat fb_status block can call it after posting.
Comment #2
ManyNancy commentedDoes this mean I should use shout in place of fb status for 'wall' postings?
Comment #3
Stalski commentedThat's your choice. The maintainer of facebook_status said to me a couple of times that his module has lots of functionality more than shouts, so that's the factor for your decision i guess. If you use shouts, it's just a small post you can do to the stream. (no twitter behaviour)
For the facebook status update stream thing , it's currently not possible to hook into the afterStatusUpdate process of fb_status. I think you can ask him (IceCreamYou) and it's not that hard to implement such a callback. (Flag does it for instance)
Comment #4
ManyNancy commentedOK, the issue is here: #735326: Javascript Event for submission success.
Thanks.
Comment #5
Stalski commentedok subscribed myself to it :)
Comment #6
ManyNancy commentedThe latest version of fbstatus has the event.
Comment #7
Stalski commentedcool :)
Then why do you reopen this ticket? It's you who can fix this in your custom glue module. Heartbeat can never supply this in the module ofcourse.
Just do like the shout module and call the poll for newer messages in the fb_status callback.
regards stalski
Comment #8
icecreamyou commentedUpdating a Heartbeat view when a Facebook-style Status is submitted can be done in one of several ways.
Assuming this works (I haven't actually tried it) I think it may be a good idea to just add this to FBSS itself.
I'm about 90% sure this option works.
Comment #9
Stalski commentedHey,
thx and you are correct about the approaches you suggest.
In my opinion, the best option is a direct approach like possibility 3, however without the hard-coded link to another module (heartbeat). So what you could do for all contributed modules is the flag-approach. You provide javascript-hooks to do something custom "before fbss is submit" and "after fbss is submit".
Approach Four will work as well and you can indeed use the behaviors in your module. (In heartbeat i could not so that since poll messages would have to reattach behavior, adding the polling behavior again (and again and again untill js-crash).
I will try out all approaches at my demo site and implement (+ document) the best approach that i see (this will probably be the one with the smallest load).
thx again :)
Comment #10
icecreamyou commentedFBSS does allow using JavaScript events for "before" and "after" status submission as well as clicking the "Refresh" link if that is enabled. (The "click" event is enough for "before," and "ahah_success" is invoked "after.")
I don't mind hard-coding Heartbeat integration since it's only 3 lines, as long as everything still works whether Heartbeat is installed or not. I will look forward to hearing from you which approach works best before I do anything though. Thanks for being willing to test!
Comment #11
Stalski commentedComment #12
JJacobo commentedWas this ever hardcoded?
Comment #13
icecreamyou commentedYou mean in the two weeks since it was proposed and not marked fixed? No. As I said above,
Since this issue hasn't been updated since then, I haven't heard anything, so I haven't hard-coded any of the solutions proposed above. When I have, this issue will be updated and it will appear in the CVS commit log.
Comment #14
JJacobo commentedYou're a bit touchy, no? I don't think that sarcasm was necessary there.
I was just asking because we're trying to get this to work.
Comment #15
icecreamyou commentedI apologize.
Comment #16
icecreamyou commentedI committed option #3 to FBSS dev.