Welcome Guest, Not a member yet? Register   Sign In
Asyncronous work
#4

(This post was last modified: 05-31-2015, 02:35 PM by no1youknowz.)

Message Queue every time.

The reason for this, it doesn't matter if its javascript or PHP. Both listen to MQ and both can send and receive. It's completely agnostic.

If I was having a page load depending on 3rd party data. I would load the page and in php fire off the "sends" to the queue which would in-turn ping all the social networks. It would then push back the result into another queue where javascript is listening and update the page.

When the page loads because its handed over to an MQ, there would be no delay. In-fact you can always have a static "Please wait" in those sections. They would be loaded in when javascript responds with the payload.

As you are doing now. You can extend the php to check against the timestamp say in redis/aeropsike and if past a certain time go to the social sites, otherwise retrieve cached info.

Pretty trivial to implement.
Reply


Messages In This Thread
Asyncronous work - by albertleao - 05-28-2015, 01:04 PM
RE: Asyncronous work - by mwhitney - 05-28-2015, 01:58 PM
RE: Asyncronous work - by CroNiX - 05-28-2015, 02:08 PM
RE: Asyncronous work - by no1youknowz - 05-31-2015, 02:34 PM
RE: Asyncronous work - by albertleao - 06-02-2015, 08:29 AM
RE: Asyncronous work - by no1youknowz - 06-02-2015, 08:51 AM
RE: Asyncronous work - by ivantcholakov - 05-31-2015, 02:50 PM



Theme © iAndrew 2016 - Forum software by © MyBB