clarin-eric / component-registry-rest

Component Registry back end
GNU General Public License v3.0
2 stars 1 forks source link

Asynchronous transformation and validation #31

Open twagoo opened 7 years ago

twagoo commented 7 years ago

Transformation (xml->xsd) and validation can be relatively expensive operations. It might be a good idea to make use of Jersey's asynchronous Server API to (theoretically) increase the throughput of the server:

In this model, the association between a request processing thread and client connection is broken. I/O container that handles incoming request may no longer assume that a client connection can be safely closed when a request processing thread returns. Instead a facility for explicitly suspending, resuming and closing client connections needs to be exposed. Note that the use of server-side asynchronous processing model will not improve the request processing time perceived by the client. It will however increase the throughput of the server, by releasing the initial request processing thread back to the I/O container while the request may still be waiting in a queue for processing or the processing may still be running on another dedicated thread. The released I/O container thread can be used to accept and process new incoming request connections.

This may mitigate the 'broken pipe' SocketException (see Trac #714) occurring regularly but this is speculative.