Documentation ¶
Index ¶
- type Stack
- func (stack *Stack) Destroy(_ context.Context)
- func (stack *Stack) FindAndRemoveByPid(pid int64) bool
- func (stack *Stack) IsEmpty() bool
- func (stack *Stack) Pop() (worker.BaseProcess, bool)
- func (stack *Stack) Push(w worker.BaseProcess)
- func (stack *Stack) Reset()
- func (stack *Stack) Workers() []worker.BaseProcess
- type Vec
- type Vector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stack ¶
func NewWorkersStack ¶
func (*Stack) FindAndRemoveByPid ¶
func (*Stack) Push ¶
func (stack *Stack) Push(w worker.BaseProcess)
Push worker back to the vec If vec in destroy state, Push will provide 100ms window to unlock the mutex
func (*Stack) Workers ¶
func (stack *Stack) Workers() []worker.BaseProcess
Workers return copy of the workers in the vec
type Vec ¶
type Vec struct {
// contains filtered or unexported fields
}
func (*Vec) Enqueue ¶
func (v *Vec) Enqueue(w worker.BaseProcess)
type Vector ¶
type Vector interface { // Enqueue used to put worker to the vector Enqueue(worker.BaseProcess) // Dequeue used to get worker from the vector Dequeue() (worker.BaseProcess, bool) // Destroy used to stop releasing the workers Destroy() }
Vector interface represents vector container
Click to show internal directories.
Click to hide internal directories.