The design mock up
What we have above is the proposed app overview.
Here is a brief overview of what is actually happening:
- Requester (User) Sends a request for a resource to the system. The resource could be HTML, Report etc
- Controller receives the requests and returns a HTTP 202 response. See http://en.wikipedia.org/wiki/List_of_HTTP_status_codes for more details on HTTP status codes.
- Controller sends job parameters to model
- Controllers sends the url that will call the appropriate worker to the queue manager
- Queue manager receives job request
- Queue manager evaluates systems resources and decides sends requests to workers. This can be done via curl. The queue manager should not wait for a response
- Worker does the time intensive task and on completion (successfully or not) sends output back to the Queue manager
- The Queue manager updates the progress to the model
- Requester(User) sends request for the current progress.
- Controller checks progress from the model, if complete returns the resource if not, returns the progress information that is available
Obviously not all work flows will fit this suggested work flow, regardless this should at least come close.
Next time we are going to go through a sample implementation of this design.
If you have any questions please drop a comment below. Remember to follow me on twitter.
by Jacob Chencha