Question is: are adapters thread-safe?
We know that adapters can have session variables, so that state created by one call from a client is accessible on a subsequent call (assuming session affinity if we are using a cluster). An example question/answer here confirming that.
Given that client code is making asynchronous calls to adapters it's clearly possible for a client to issue multiple simultaneous requests to an adapter and hence there is a potential for a race condition between two such requests hitting the same session variables.
I see two possibilities (ignoring for the moment the issue of consistency between cluster members):
The Worklight Server might permit parallel requests to run in separate threads in which case if the session state variables have the potential for material inconsistency synchronisation will be required and we need to use Java constructs or a database to achieve whatever thread-safe logic we must implement.
The Worklight Server might queue requests for a session hence Adapters are thread safe (within a single process) and hence our code is somewhat simpler.
What does Worklight promise?