hashex

command module
v0.0.0-...-927ded2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2018 License: MIT Imports: 16 Imported by: 0

README

Hashex

hashex is an example server of an asynchronous hashing service.

The overall structure of the code is broken into 4 parts:

  1. task.Manager provides the business logic of running async tasks tracked by id.
  2. HashApi layers the desired HTTP API semantics onto the task.Manager, and HashTask provides the actual hash operation.
  3. EndPointStatsTracker implements the performance tracking, wrapping the HashApi endpoint.
  4. main() plugs everything together and handles shutdown.

The code can be run using

go build . && ./hashex -port 8080

Documentation

Overview

hashex is an example server of an asynchronous hashing service.

The overall structure of the code is broken into 4 parts:

  1. task.Manager provides the business logic of running async tasks tracked by id.
  2. HashApi layers the desired HTTP API semantics onto the task.Manager, and HashTask provides the actual hash operation.
  3. EndPointStatsTracker implements the performance tracking, wrapping the HashApi endpoint.
  4. 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. :-/

Directories

Path Synopsis
Package task implements a simple asynchronous task management scheme.
Package task implements a simple asynchronous task management scheme.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL