Clockworks distributed simulation app for android devices
#Server
- Listen for environments from users over HTTPS, authentication is optional
- Get number of recent devices from Ping Queue.
- Get space in Code Queue.
- Split code based on number of available devices, (i.e. split amout is minimum of: pings received in the previous allowed window, space in queue and how much the code can be split) and add to code queue
- Respond to users with rejects/acknowledgements
- User authentication
- Ping queue: Pop off expired and read size
- Code queue: Check if full and add to Queue
- Listen for WOP Pings from users over HTTPS, authentication is optional
- Check if database complete with all results
- Respond to users with rejects/acknowledgement/compiled results
- User authentication
- Results: read/purge
- Listen for HTTP request from devices
- If RTP Ping:
- Strip any results from ping and enter in database
- Log to Ping Queue
- Respond
- If RTO Ping:
- Restart the processes time out
- Result logging: write
- Ping Queue: Add to Queue
- Code Queue: Take off Queue if available
- One for each process of the simulation
- Code Queue: Add to Queue if time out reached
Sample | Sample | Sample |
Sample | Sample | Sample |
Sample | Sample | Sample |
- Sent from the user after every t seconds to check if the results have been collected
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
Sample
- 200: Results
Sample
- 401: Authentication failure
Sample
- 404: Process not found
Sample
- 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
Sample Response of this type here
- 204: No code available at this time from Queue
Sample Response of this type here
- Tell the server to reset its process timer for the indicated process
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
- 200: Success
Sample
- 404: Process Not Found
Sample
#Appendix
- Yellow: Start
- Green: Data received
- Red: Response sent
- Blue: Database access
- Black: Scary Stuff
- On read:
- Pop expired pings of the top of the Queue and update size, then read size
- On write:
- Simply add ping log to the Queue
- Standard Queue of code objects that allows the threads to operate concurrently