Is it possible for Web2Py SOAP-Services to give feedback during lenghty operations?

48 views
Skip to first unread message

Oliver Holmes

unread,
Oct 20, 2016, 10:38:16 AM10/20/16
to web2py-users
I am using Web2Py on a RaspberryPI as a SOAP service provider and a very rudimentary configuration is possible through some views. User interaction is via a client application and users are mostly unaware that there is some server running in one of their shelves. I have just recently implemented a procedure to update a server via the client. It stores the current web2py-app then exports the db as csv, updates any files that need updating, clears all tables and reimports the csv. This works fine, but may result in timeout messages on the client side, as tests have shown. Besides, for the user there is no way of knowing how far the procedure has gone, and how much longer the wait will be. Is there a possibility to give feedback to the client? Any kind of message would be great just numeric to fill a progress indicator or even text to display progress messages?

Regards,
Oliver Holmes

Dave S

unread,
Oct 20, 2016, 1:44:12 PM10/20/16
to web...@googlegroups.com


Here's what I would do:  run the update as a queued task.  Have a "progress" table in the db;  it only needs to be 1 row.  [Alternate idea; store progress in a file in the filesystem; I don't think you can update the session from the Scheduler environment, BICBW].  The page that starts the update goes to a status page which displays the current progress value and has refresh set to 10 seconds or such, or it has a javascript loop that fires an AJAX request  off and sleeps for 10 seconds.

There have been some progress bars discussed here, and that should be searchable in the forum archives, but I think stupid.css (used in the current Welcome app) has that built-in; check out Massiomo's examples at <URL:https://github.com/mdipierro/stupid.css>. (about halfway down on the examples page)

/dps

Oliver Holmes

unread,
Oct 24, 2016, 4:50:54 AM10/24/16
to web2py-users
Great! Will give the queued task a go. Not quite sure how to send the feedback over my SOAP pipeline though. But I'll come up with something.

Thanks and cheers!
Reply all
Reply to author
Forward
0 new messages