MCPcopy Create free account

hub / github.com/YSZhuoyang/go-dispatcher / functions

Functions26 in github.com/YSZhuoyang/go-dispatcher

↓ 11 callersFunctionNewDispatcher
NewDispatcher returns a new job dispatcher with a worker pool initialized with given number of workers.
dispatcher/dispatcher.go:80
↓ 7 callersMethodFinalize
Finalize blocks until all jobs dispatched are finished and all workers are returned to worker pool. Note it must be called to terminate the dispatchin
dispatcher/dispatcher.go:22
↓ 4 callersMethodDispatchWithDelay
DispatchWithDelay behaves similarly to Dispatch, except it is delayed for a given period of time (in nanoseconds) before the job is allocated to a wor
dispatcher/dispatcher.go:18
↓ 3 callersMethodDispatch
Dispatch gives a job to a worker at a time, and blocks until at least one worker becomes available. Each job dispatched is handled by a separate gorou
dispatcher/dispatcher.go:15
↓ 2 callersFunctionnewError
(errMsg string)
dispatcher/error.go:11
↓ 1 callersMethodDo
()
dispatcher/job.go:8
↓ 1 callersMethodGetNumWorkersAvail
GetNumWorkersAvail returns the number of workers availalbe for tasks at the time it is called.
dispatcher/dispatcher.go:25
↓ 1 callersMethodGetTotalNumWorkers
GetTotalNumWorkers returns total number of workers created by the dispatcher.
dispatcher/dispatcher.go:27
MethodDispatch
(job Job)
dispatcher/dispatcher.go:37
MethodDispatchWithDelay
(job Job, delayPeriod time.Duration)
dispatcher/dispatcher.go:44
MethodDo
()
dispatcher/job.go:22
MethodDo
()
dispatcher/dispatcher_test.go:16
MethodDo
()
dispatcher/dispatcher_test.go:25
MethodError
()
dispatcher/error.go:7
MethodFinalize
()
dispatcher/dispatcher.go:56
MethodGetNumWorkersAvail
()
dispatcher/dispatcher.go:70
MethodGetTotalNumWorkers
()
dispatcher/dispatcher.go:74
FunctionTestDispatchingJobs
(T *testing.T)
dispatcher/dispatcher_test.go:121
FunctionTestDispatchingJobsWithDelay
(T *testing.T)
dispatcher/dispatcher_test.go:141
FunctionTestDispatchingJobsWithDelayError
(T *testing.T)
dispatcher/dispatcher_test.go:157
FunctionTestDispatchingManyJobs
(T *testing.T)
dispatcher/dispatcher_test.go:171
FunctionTestFinializingDelayedJobs
(T *testing.T)
dispatcher/dispatcher_test.go:90
FunctionTestFinializingJobs
(T *testing.T)
dispatcher/dispatcher_test.go:75
FunctionTestFinializingManyDelayedJobs
(T *testing.T)
dispatcher/dispatcher_test.go:105
FunctionTestGoroutineLeaks
(T *testing.T)
dispatcher/dispatcher_test.go:33
FunctionTestInitWorkerPool
(T *testing.T)
dispatcher/dispatcher_test.go:45