smithlabcode/amordad — pull request #14 by saketkc (2014-12-26 03:09:40+00:00)
Title: [WIP] RESTFul Service for executing queries

This is an attempt to make the query execution RESTFul.

Design(Completely asynchronous):

1. `query_server.cpp` runs in daemon mode, listens on port 8080(for example). This loads all `amordad` stuff into memory for once.
2. User uploads query[PHP implementation]. A `job_id` is created[PHP implementation again] and is returned to the frontend. The server is not busy waiting for the `query` to be over, since we are just creating a `job_id`, job is executed asynchronously
3. On successful upload => PHP makes a REST call to the server running on 8080 with the `job_id`
4. The 8080 server fetches files associated with a particular `job_id` and executes it. Just calling the `query` function, without loading everything in memory again
5. On the frontend part, using AJAX requests we check the status of the `job_id` probably every 2 seconds. something that happens on the NCBI blast page.