4 Replies Latest reply on May 14, 2013 9:15 AM by Lars Burgess

    RhoConnect poll_interval not working

      Hi,

      in my RhoConnect application i have set the poll_interval to 30 for a couple of sources, where data is queried from WCF services.

      however, i cannot see the data source being queried every 30 seconds; the data is only being queried when the device synchronizes.

       

      this behavior is making me wonder if the poll_interval setting is effective at all or not or if any other configuration is required for it to work.

      currently i have RhoStudio ver 2.2.1.13 installed and running on Win7.

       

      thanks.

        • Re: RhoConnect poll_interval not working

          i cannot see the data source being queried every 30 seconds; the data is only being queried when the device synchronizes.

           

          this behavior is making me wonder if the poll_interval setting is effective at all or not or if any other configuration is required for it to work.

          This is not what the poll_interval is designed for.  It is a throttling setting which defines the minimum amount of time that needs to pass before your backend is polled for a given user/partition.  There are no background processes auto-polling in rhoconnect, everything is on-demand, again by design (if there are no devices requesting data, rhoconnect assumes you don't want unnecessary traffic to your backend). 

           

          That being said, since rhoconnect uses resque for background job execution, you can easily add something like resque-scheduler to achieve automated periodic background tasks: https://github.com/bvandenbos/resque-scheduler

          • Re: RhoConnect poll_interval not working
            Peter Arcuri

            That is correct the data is being queried when the device synchronizes. An event needs to trigger the process such as Login. The poll_interval attribute may be misleading in that it's used to check last sync whether or not it ran within the poll_interval time. IE: if poll_interval is set to 30 seconds then when the SyncEngine is launched, it will check if the last instance was greater then 30 seconds. If true then run else don't run.

             

            If you want an auto sync on a set interval you may want to create a loop that runs "SyncEngine.dosync" every 30 seconds. As an alternative you may want to use RhoConnect_Push so that data syncs only when changed are made from backend.

             

            http://docs.rhomobile.com/rhodes/synchronization

            1 of 1 people found this helpful