Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Hash is the bcrypt work type Hash op = "encrypt" // Compare is bcrypt compare work Compare = "decrypt" )
Variables ¶
This section is empty.
Functions ¶
func Dispatch ¶
func Dispatch(numWorker int) (context.CancelFunc, chan WorkRequest, chan WorkResponse)
Dispatch creates numWorker workers, returns a cancel functionand channels for adding work and responses, cancel must be called
func Worker ¶
func Worker(ctx context.Context, id int, in chan WorkRequest, out chan WorkResponse)
Worker loops forever and is part of the worker pool
Types ¶
type WorkRequest ¶
WorkRequest is a worker req
type WorkResponse ¶
type WorkResponse struct { Wr WorkRequest Result []byte Matched bool Err error }
WorkResponse is a worker resp
func Process ¶
func Process(wr WorkRequest) WorkResponse
Process dispatches work to the worker pool channel
Click to show internal directories.
Click to hide internal directories.