Thanks a lot.
With your Test sample my test code is working now. I can process the
next step...
What i would like to do now is to integrate a background syncing
process (with WorkerPool) between the local Gear database and my Mysql
Database...
Without WorkerPool my synchronization is working. I'm using GWT-RPC to
exchange data between browser and server.
My Question:
How to add my syncing code in the Javascript string (i need to use a
GWT java method...)??
I would like to replace the WORKER_JS_SRC with a call to my java
method:
workerId = workerPool.createWorkerFromString(WORKER_JS_SRC);
private static final String WORKER_JS_SRC = ""
+ "function workerInit() {"
+ " google.gears.workerPool.onmessage = function(messageString,
srcWorkerId){"
+ " google.gears.workerPool.sendMessage('done',
srcWorkerId);"
+ " };" + "}" + "workerInit();";
I would like to use this java method instead...
public void sync() {
rpcKeepAlive =
(SyncServiceAsync)GWT.create(SyncService.class);
String rpcUrl = GWT.getModuleBaseURL() + "sync";
((ServiceDefTarget)rpcKeepAlive).setServiceEntryPoint(rpcUrl);
Timer t = new Timer() {
@Override
public void run() {
..sync code
}
};
t.scheduleRepeating(10000);
}
Regards,
Fred