I committed a change to GWTServiceLookup so it can now support obtaining
manager proxies such that an RPC call can have a custom timeout.
The default timeout is now 10s. If you are in debug mode, all time outs
will be increased by an additional 30s. So if you are in debug mode, the
default timeout will be 40s. If you have a customized timeout of N
seconds, and you are in debug mode, the timeout will be N+30. (this
additional "fudge factor" is required since the gwt debug mode is much
slower than when running non-debug mode).
Today there is only one gwt service proxy that you can ask for a custom
timeout:
GWTServiceLookup.getResourceTypeGWTService(int timeout)
Since most of our proxies call methods that don't need very long
timeouts, we don't need extra APIs to customize the timeout (i.e. the
default is fine). Thus I only created this one for now (no need bloating
the code in GWTServiceLookup unnecessarily).
However, if you think you will need a service proxy with a custom
timeout, add a static method to GWTServiceLookup - just copy the one
no-arg method and add a "int timeout" param and pass that timeout value
to the secure() method. See that getResourceTypeGWTService as an example.
Note that, again, this will be a rare need and in fact we should strive
to have very fast RPC calls (subsecond should be the norm in this kind
of client-side/ajaxy/GWT style of app). However, today we may have
legacy queries/workflows that do take a long time to execute on the
server side. Until we can refactor things to work faster in this new
paradigm of gwt, this timeout feature will be useful.
Show replies by date