Clockworks distributed simulation app for android devices
#Server
- Get environments from users over HTTP.
- Split code into all permutations of variable categories given and add to Code Queue
- Respond to users with rejects/acknowledgements
- Code queue: Add to Queue
- Listen for WOP Pings from users over HTTP.
- Check if Environment is complete with all results
- Respond to users with rejects/acknowledgement/compiled results
- Listen for HTTP request from devices
- If RTP Ping:
- Strip any results from ping and add to segment
- Respond
- If RTO Ping:
- Restart the segment's timer
- Code Queue: Take off Queue if available
- One process for each segment of the simulation environments
- Code Queue: Re-add segment to Queue if time out interval reached
- Ping server to indicate readiness to process
- Process python script
- Sent from the user after every t seconds to check whether all results have been collated
GET /resultassemblyhandler HTTP/1.1 Host: www.example.com Content-Type: text/plain-text; charset=utf-8 Content-Length: length Environment-Id: 0
- 102: Process Not ready
- 200: Results
[
{
"params":[
"param1",
"rap"
],
"results" : "result",
"script-valid":true
},
{
"params":[
"param1",
"rap"
],
"results" : "result",
"valid":true
}
]
- 404: Process not found
- Contains results from a previously sent process if such a process exists
- Expects response of a new process
GET /botrequesthandler HTTP/1.1 Host: www.example.com Content-Type: text/plain-text; charset=utf-8 Content-Length: length Environment-Id: 0 Segment-Id: 0 May contain traces of results
- 200: Response with code to run
{
"script" : "script"
}
- 204: No code available at this time from Queue
- 400: Bad Headers
- 404: Process Not Found
- 409: Conflict (duplicate results)
- Tell the server to reset its process timer for the indicated segment
POST /botrequesthandler HTTP/1.1
Host: www.example.com
Content-Type: text/plain-text; charset=utf-8
Content-Length: length
Environment-Id: 0
Segment-Id: 0
- 201: Created new timer process
- 404: Process Not Found
- The user-defined simulation
- Creation defines the Environment Segments for this simulation
- Segment of a simulation
- Sent to bot as string representing a file contents unifying script and relevant parameters
- Returned to user as string of results
#Appendix
- Yellow: Start
- Green: Data received
- Red: Response sent
- Black: Segments created
- Standard Queue of code objects that allows the threads to operate concurrently