Hashex
hashex
is an example server of an asynchronous hashing service.
The overall structure of the code is broken into 4 parts:
- task.Manager provides the business logic of running async tasks tracked by id.
- HashApi layers the desired HTTP API semantics onto the task.Manager, and HashTask provides the actual hash operation.
- EndPointStatsTracker implements the performance tracking, wrapping the HashApi endpoint.
- main() plugs everything together and handles shutdown.
The code can be run using
go build . && ./hashex -port 8080