command
module
Version:
v0.0.0-...-927ded2
Opens a new window with list of versions in this module.
Published: Aug 6, 2018
License: MIT
Opens a new window with license information.
Imports: 16
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
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
Documentation
¶
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.
Graceful shutdown is done via a combination of task.Manager and main. This
pierces the HashApi abstraction a bit. :-/
Source Files
¶
Directories
¶
Package task implements a simple asynchronous task management scheme.
|
Package task implements a simple asynchronous task management scheme. |
Click to show internal directories.
Click to hide internal directories.