In testing calling cefQuery our JS code appears to hang until our executing Java thread (inside the onQuery()) completes. Is this behavior expected? All the CEF documentation seems to suggest that the call initiated by cefQuery is done so asynchronously, but perhaps this is not true for JCEF? Additionally, the last line of Marshall's reply here viewtopic.php?f=17&t=12317 reads:
You should perform communication with your back-end server on a separate thread and execute CefQueryCallback asynchronously once the response is available.
Which could be interpreted as not doing that would result in the entire operation (JS->Java->JS) being performed synchronously.
Indeed, using a separate thread within our onQuery() method causes the operation perform asynchronously, which suggests that the JS code is in fact waiting for our thread to return before proceeding. My question is is this necessary? Or are we somehow using cefQuery incorrectly. I'll mention that we're not actually calling cefQuery, but a custom function (call it fooCefQuery) which is functionally identical to cefQuery, and is registered like so:
CefMessageRouter fooMessageRouter= CefMessageRouter.create(new CefMessageRouterConfig(FOO_CEF_QUERY, FOO_CEF_QUERY_CANCEL));