Best practice to implement one way (client to server) syncing?

I am looking for a way to use rhoconnect's sync engine to send data from the client to the server, but then never bring that data back down again in the model's query method.  I have tried using pass through, as well as hard coding a place holder record in the query method, and both of these processes leave orphaned data on the clients, with the object ID that the client generated, as seen in the attached screen shot.  Ideally the placeholder record would stay, and the other record would be removed from the client after syncing. 

Thanks in advance for any ideas,

MAB

Kutir Mobility
Hi Mark,As you know

Hi Mark,

As you know rhoConnect is designed from our ground for two-way syncing. Wish there is a variable to set one way. :).

Do you think you can use RESTFul API for sending data from Client to Server and then flush it?

Visnupriya R

Kutir Mobility

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kutir Mobility
Mark,Have you check settings

Mark,

Have you check settings/settings.yml with poll_interval value is 0

Example:

:sources:

  MyModel:

    :poll_interval: 0

Visnupriya R

Kutir Mobility

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Tom Carvin
What effect, exactly, does

What effect, exactly, does poll_interval of 0 have in this case?  When the client syncs and the source adapter has received the "one-way" records via multiple calls to create, does poll_interval 0 mean that query will never be called on it to fetch the data back down (presumably at that point only syncing with the dataset in redis)?  I'm new to RhoConnect and I'm trying to understand the syncing architecture in depth.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kutir Mobility
Tom,"poll_interval" uses to

Tom,

"poll_interval" uses to trigger sync in certain time interval between RhoConnect and Server.

For example: If you set poll_interval is 10 sec for specific model, it will trigger sync every 10 sec.

Visnupriya R

Kutir Mobility

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Tom Carvin
Yes, thanks.  But what

Yes, thanks.  But what exactly happens with a poll_interval of zero?  I have a similar situation as the original poster, where one of the models holds, effectively, requests to a one-way service such that when they are synced up the source adapter needs to invoke an external API, but there is no data record to get queried back down.  If I set poll_interval to 0, will it create a one-way only source adapter?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Well, no harm trying it out,

Well, no harm trying it out, is there?

I doubt poll interval duration has anything to do with one way or two way sync, however.

Maybe you can explore AsyncHTTP or alternative sync engines.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Tom Carvin
I'm working on it,

I'm working on it, unfortunately that is how it is with *everything* in this framework...just keep trying it and see what works.  Burns a lot of time to discover iteratively what works instead of being able to utilize documentation, support forums, or the like to get official answers.


One way sync in this case just means that the source adapter query method won't get called, just the create.  If poll_interval of zero disabled the query poll, then it might have the desired effect?  I'll post back if I find anything definitive.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Mark Nongkhlaw
Hi Tom, did it finally work

Hi Tom, did it finally work for you?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Tom Carvin
Thanks for everyone;s replies

Thanks for everyone;s replies.  I put this one on the shelf to deal with a few other Rho issues.  I'll post back when I get back to this one after Thanksgiving.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kutir Mobility
Tom, To achieve one way sync

Tom, To achieve one way sync between Rhodes app and server, we need to duplicate table. E.g Let try One way sync for Employee table, Create Employee and EmployeeMaster tables.  Enable sync for employee. Whenever new record inserted in Employee table, insert in EmployeeMaster table also. Do sync for employee table. From RhoConnect, Avoid query methods, create method will sync records from Rhodes app to server via RhoConnect. EmployeeMaster is for local reference, because on each sync employee table will be cleared. Visnupriya R Kutir Mobility

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Pietro Francesc...
Hi Tom,the poll_interval

Hi Tom,

the poll_interval parameter control the sync poll interval, and is an amount of seconds. If you set this to zero, you're simply disabling the automatic sync.

To achieve a one way only sync you need to work on the source adapter, I've never tested this, however I think that having the query method always returning an empty result hash would make the trick. The issue you reported seems more linked to not returning the id to rhoconnect during the create method.

is it possible to see the source code of these two methods?

~Pietro

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments