On Wednesday, July 13, 2016 at 12:31:13 PM UTC-4, Chetan Jain wrote: > > Hi Anthony, > > > Scenario is : I've to send a 'status' SMS to a phone_number after every > 30 minutes and Append its Status statement on a webpage, Since I have to > send SMS after every 30 minutes, I have to call function after 30 minutes > each. >
Are you saying you are automatically sending the SMS messages via a background process or scheduled task (i.e., regardless of whether anyone is viewing the status on a web page), and you just need a web page to show each new message as it is sent? If so, I suppose you could store the messages somewhere as they go out (e.g., in the database or in RAM or disk cache). Then when the web page is first loaded, check when the most recent SMS was sent, and then have the page make an Ajax call 30 minutes after the last SMS and every 30 minutes thereafter. Upon each 30 minute check, if the next SMS has not gone out yet, just keep doing Ajax calls every second or two until the message has gone out -- then wait another 30 minutes and repeat. Alternatively, you could set up a websocket <https://github.com/web2py/web2py/blob/R-2.14.6/gluon/contrib/websocket_messaging.py> to push the notification to the web page. Anthony -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.