Documentation ¶
Overview ¶
Package taskqueue is a generated GoMock package.
Index ¶
- func ScanTQueueBySubKey(queue TQueue, subKey task.TKey) ([]task.Task, error)
- func ScanTQueueWithLimitBySubKey(queue TQueueWithLimit, subKey task.TKey) ([]task.Task, error)
- type MockTQueue
- func (m *MockTQueue) Cap() int
- func (m *MockTQueue) EXPECT() *MockTQueueMockRecorder
- func (m *MockTQueue) Has(arg0 task.TKey) bool
- func (m *MockTQueue) Len() int
- func (m *MockTQueue) Pop() task.Task
- func (m *MockTQueue) PopByKey(arg0 task.TKey) task.Task
- func (m *MockTQueue) Push(arg0 task.Task) error
- func (m *MockTQueue) ScanTask(arg0 func(task.Task))
- func (m *MockTQueue) Top() task.Task
- type MockTQueueMockRecorder
- func (mr *MockTQueueMockRecorder) Cap() *gomock.Call
- func (mr *MockTQueueMockRecorder) Has(arg0 any) *gomock.Call
- func (mr *MockTQueueMockRecorder) Len() *gomock.Call
- func (mr *MockTQueueMockRecorder) Pop() *gomock.Call
- func (mr *MockTQueueMockRecorder) PopByKey(arg0 any) *gomock.Call
- func (mr *MockTQueueMockRecorder) Push(arg0 any) *gomock.Call
- func (mr *MockTQueueMockRecorder) ScanTask(arg0 any) *gomock.Call
- func (mr *MockTQueueMockRecorder) Top() *gomock.Call
- type MockTQueueOnStrategy
- func (m *MockTQueueOnStrategy) Cap() int
- func (m *MockTQueueOnStrategy) EXPECT() *MockTQueueOnStrategyMockRecorder
- func (m *MockTQueueOnStrategy) Has(arg0 task.TKey) bool
- func (m *MockTQueueOnStrategy) Len() int
- func (m *MockTQueueOnStrategy) Pop() task.Task
- func (m *MockTQueueOnStrategy) PopByKey(arg0 task.TKey) task.Task
- func (m *MockTQueueOnStrategy) Push(arg0 task.Task) error
- func (m *MockTQueueOnStrategy) ScanTask(arg0 func(task.Task))
- func (m *MockTQueueOnStrategy) SetFilterTaskStrategy(arg0 func(task.Task) bool)
- func (m *MockTQueueOnStrategy) SetRetireTaskStrategy(arg0 func(task.Task) bool)
- func (m *MockTQueueOnStrategy) Top() task.Task
- type MockTQueueOnStrategyMockRecorder
- func (mr *MockTQueueOnStrategyMockRecorder) Cap() *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) Has(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) Len() *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) Pop() *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) PopByKey(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) Push(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) ScanTask(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) SetFilterTaskStrategy(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) SetRetireTaskStrategy(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyMockRecorder) Top() *gomock.Call
- type MockTQueueOnStrategyWithLimit
- func (m *MockTQueueOnStrategyWithLimit) Cap() int
- func (m *MockTQueueOnStrategyWithLimit) EXPECT() *MockTQueueOnStrategyWithLimitMockRecorder
- func (m *MockTQueueOnStrategyWithLimit) Has(arg0 task.TKey) bool
- func (m *MockTQueueOnStrategyWithLimit) Len() int
- func (m *MockTQueueOnStrategyWithLimit) PopByKey(arg0 task.TKey) task.Task
- func (m *MockTQueueOnStrategyWithLimit) PopByLimit(arg0 rcmgr.Limit) task.Task
- func (m *MockTQueueOnStrategyWithLimit) Push(arg0 task.Task) error
- func (m *MockTQueueOnStrategyWithLimit) ScanTask(arg0 func(task.Task))
- func (m *MockTQueueOnStrategyWithLimit) SetFilterTaskStrategy(arg0 func(task.Task) bool)
- func (m *MockTQueueOnStrategyWithLimit) SetRetireTaskStrategy(arg0 func(task.Task) bool)
- func (m *MockTQueueOnStrategyWithLimit) TopByLimit(arg0 rcmgr.Limit) task.Task
- type MockTQueueOnStrategyWithLimitMockRecorder
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Cap() *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Has(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Len() *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) PopByKey(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) PopByLimit(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Push(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) ScanTask(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) SetFilterTaskStrategy(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) SetRetireTaskStrategy(arg0 any) *gomock.Call
- func (mr *MockTQueueOnStrategyWithLimitMockRecorder) TopByLimit(arg0 any) *gomock.Call
- type MockTQueueStrategy
- type MockTQueueStrategyMockRecorder
- type MockTQueueWithLimit
- func (m *MockTQueueWithLimit) Cap() int
- func (m *MockTQueueWithLimit) EXPECT() *MockTQueueWithLimitMockRecorder
- func (m *MockTQueueWithLimit) Has(arg0 task.TKey) bool
- func (m *MockTQueueWithLimit) Len() int
- func (m *MockTQueueWithLimit) PopByKey(arg0 task.TKey) task.Task
- func (m *MockTQueueWithLimit) PopByLimit(arg0 rcmgr.Limit) task.Task
- func (m *MockTQueueWithLimit) Push(arg0 task.Task) error
- func (m *MockTQueueWithLimit) ScanTask(arg0 func(task.Task))
- func (m *MockTQueueWithLimit) TopByLimit(arg0 rcmgr.Limit) task.Task
- type MockTQueueWithLimitMockRecorder
- func (mr *MockTQueueWithLimitMockRecorder) Cap() *gomock.Call
- func (mr *MockTQueueWithLimitMockRecorder) Has(arg0 any) *gomock.Call
- func (mr *MockTQueueWithLimitMockRecorder) Len() *gomock.Call
- func (mr *MockTQueueWithLimitMockRecorder) PopByKey(arg0 any) *gomock.Call
- func (mr *MockTQueueWithLimitMockRecorder) PopByLimit(arg0 any) *gomock.Call
- func (mr *MockTQueueWithLimitMockRecorder) Push(arg0 any) *gomock.Call
- func (mr *MockTQueueWithLimitMockRecorder) ScanTask(arg0 any) *gomock.Call
- func (mr *MockTQueueWithLimitMockRecorder) TopByLimit(arg0 any) *gomock.Call
- type NewTQueue
- type NewTQueueOnStrategy
- type NewTQueueOnStrategyWithLimit
- type NewTQueueWithLimit
- type NilQueue
- func (*NilQueue) Cap() int
- func (*NilQueue) Has(task.TKey) bool
- func (*NilQueue) Len() int
- func (*NilQueue) Pop() task.Task
- func (*NilQueue) PopByKey(task.TKey) task.Task
- func (*NilQueue) PopByLimit(rcmgr.Limit) task.Task
- func (*NilQueue) Push(task.Task) error
- func (*NilQueue) ScanTask(func(task.Task))
- func (*NilQueue) SetFilterTaskStrategy(func(task.Task) bool)
- func (*NilQueue) SetRetireTaskStrategy(func(task.Task) bool)
- func (*NilQueue) Top() task.Task
- func (*NilQueue) TopByLimit(rcmgr.Limit) task.Task
- type TQueue
- type TQueueOnStrategy
- type TQueueOnStrategyWithLimit
- type TQueueStrategy
- type TQueueWithLimit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ScanTQueueBySubKey ¶
Types ¶
type MockTQueue ¶ added in v0.2.4
type MockTQueue struct {
// contains filtered or unexported fields
}
MockTQueue is a mock of TQueue interface.
func NewMockTQueue ¶ added in v0.2.4
func NewMockTQueue(ctrl *gomock.Controller) *MockTQueue
NewMockTQueue creates a new mock instance.
func (*MockTQueue) EXPECT ¶ added in v0.2.4
func (m *MockTQueue) EXPECT() *MockTQueueMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTQueue) Has ¶ added in v0.2.4
func (m *MockTQueue) Has(arg0 task.TKey) bool
Has mocks base method.
func (*MockTQueue) Pop ¶ added in v0.2.4
func (m *MockTQueue) Pop() task.Task
Pop mocks base method.
func (*MockTQueue) PopByKey ¶ added in v0.2.4
func (m *MockTQueue) PopByKey(arg0 task.TKey) task.Task
PopByKey mocks base method.
func (*MockTQueue) Push ¶ added in v0.2.4
func (m *MockTQueue) Push(arg0 task.Task) error
Push mocks base method.
func (*MockTQueue) ScanTask ¶ added in v0.2.4
func (m *MockTQueue) ScanTask(arg0 func(task.Task))
ScanTask mocks base method.
func (*MockTQueue) Top ¶ added in v0.2.4
func (m *MockTQueue) Top() task.Task
Top mocks base method.
type MockTQueueMockRecorder ¶ added in v0.2.4
type MockTQueueMockRecorder struct {
// contains filtered or unexported fields
}
MockTQueueMockRecorder is the mock recorder for MockTQueue.
func (*MockTQueueMockRecorder) Cap ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) Cap() *gomock.Call
Cap indicates an expected call of Cap.
func (*MockTQueueMockRecorder) Has ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) Has(arg0 any) *gomock.Call
Has indicates an expected call of Has.
func (*MockTQueueMockRecorder) Len ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len.
func (*MockTQueueMockRecorder) Pop ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) Pop() *gomock.Call
Pop indicates an expected call of Pop.
func (*MockTQueueMockRecorder) PopByKey ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) PopByKey(arg0 any) *gomock.Call
PopByKey indicates an expected call of PopByKey.
func (*MockTQueueMockRecorder) Push ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) Push(arg0 any) *gomock.Call
Push indicates an expected call of Push.
func (*MockTQueueMockRecorder) ScanTask ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) ScanTask(arg0 any) *gomock.Call
ScanTask indicates an expected call of ScanTask.
func (*MockTQueueMockRecorder) Top ¶ added in v0.2.4
func (mr *MockTQueueMockRecorder) Top() *gomock.Call
Top indicates an expected call of Top.
type MockTQueueOnStrategy ¶ added in v0.2.4
type MockTQueueOnStrategy struct {
// contains filtered or unexported fields
}
MockTQueueOnStrategy is a mock of TQueueOnStrategy interface.
func NewMockTQueueOnStrategy ¶ added in v0.2.4
func NewMockTQueueOnStrategy(ctrl *gomock.Controller) *MockTQueueOnStrategy
NewMockTQueueOnStrategy creates a new mock instance.
func (*MockTQueueOnStrategy) Cap ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) Cap() int
Cap mocks base method.
func (*MockTQueueOnStrategy) EXPECT ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) EXPECT() *MockTQueueOnStrategyMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTQueueOnStrategy) Has ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) Has(arg0 task.TKey) bool
Has mocks base method.
func (*MockTQueueOnStrategy) Len ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) Len() int
Len mocks base method.
func (*MockTQueueOnStrategy) Pop ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) Pop() task.Task
Pop mocks base method.
func (*MockTQueueOnStrategy) PopByKey ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) PopByKey(arg0 task.TKey) task.Task
PopByKey mocks base method.
func (*MockTQueueOnStrategy) Push ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) Push(arg0 task.Task) error
Push mocks base method.
func (*MockTQueueOnStrategy) ScanTask ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) ScanTask(arg0 func(task.Task))
ScanTask mocks base method.
func (*MockTQueueOnStrategy) SetFilterTaskStrategy ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) SetFilterTaskStrategy(arg0 func(task.Task) bool)
SetFilterTaskStrategy mocks base method.
func (*MockTQueueOnStrategy) SetRetireTaskStrategy ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) SetRetireTaskStrategy(arg0 func(task.Task) bool)
SetRetireTaskStrategy mocks base method.
func (*MockTQueueOnStrategy) Top ¶ added in v0.2.4
func (m *MockTQueueOnStrategy) Top() task.Task
Top mocks base method.
type MockTQueueOnStrategyMockRecorder ¶ added in v0.2.4
type MockTQueueOnStrategyMockRecorder struct {
// contains filtered or unexported fields
}
MockTQueueOnStrategyMockRecorder is the mock recorder for MockTQueueOnStrategy.
func (*MockTQueueOnStrategyMockRecorder) Cap ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) Cap() *gomock.Call
Cap indicates an expected call of Cap.
func (*MockTQueueOnStrategyMockRecorder) Has ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) Has(arg0 any) *gomock.Call
Has indicates an expected call of Has.
func (*MockTQueueOnStrategyMockRecorder) Len ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len.
func (*MockTQueueOnStrategyMockRecorder) Pop ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) Pop() *gomock.Call
Pop indicates an expected call of Pop.
func (*MockTQueueOnStrategyMockRecorder) PopByKey ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) PopByKey(arg0 any) *gomock.Call
PopByKey indicates an expected call of PopByKey.
func (*MockTQueueOnStrategyMockRecorder) Push ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) Push(arg0 any) *gomock.Call
Push indicates an expected call of Push.
func (*MockTQueueOnStrategyMockRecorder) ScanTask ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) ScanTask(arg0 any) *gomock.Call
ScanTask indicates an expected call of ScanTask.
func (*MockTQueueOnStrategyMockRecorder) SetFilterTaskStrategy ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) SetFilterTaskStrategy(arg0 any) *gomock.Call
SetFilterTaskStrategy indicates an expected call of SetFilterTaskStrategy.
func (*MockTQueueOnStrategyMockRecorder) SetRetireTaskStrategy ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) SetRetireTaskStrategy(arg0 any) *gomock.Call
SetRetireTaskStrategy indicates an expected call of SetRetireTaskStrategy.
func (*MockTQueueOnStrategyMockRecorder) Top ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyMockRecorder) Top() *gomock.Call
Top indicates an expected call of Top.
type MockTQueueOnStrategyWithLimit ¶ added in v0.2.4
type MockTQueueOnStrategyWithLimit struct {
// contains filtered or unexported fields
}
MockTQueueOnStrategyWithLimit is a mock of TQueueOnStrategyWithLimit interface.
func NewMockTQueueOnStrategyWithLimit ¶ added in v0.2.4
func NewMockTQueueOnStrategyWithLimit(ctrl *gomock.Controller) *MockTQueueOnStrategyWithLimit
NewMockTQueueOnStrategyWithLimit creates a new mock instance.
func (*MockTQueueOnStrategyWithLimit) Cap ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) Cap() int
Cap mocks base method.
func (*MockTQueueOnStrategyWithLimit) EXPECT ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) EXPECT() *MockTQueueOnStrategyWithLimitMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTQueueOnStrategyWithLimit) Has ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) Has(arg0 task.TKey) bool
Has mocks base method.
func (*MockTQueueOnStrategyWithLimit) Len ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) Len() int
Len mocks base method.
func (*MockTQueueOnStrategyWithLimit) PopByKey ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) PopByKey(arg0 task.TKey) task.Task
PopByKey mocks base method.
func (*MockTQueueOnStrategyWithLimit) PopByLimit ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) PopByLimit(arg0 rcmgr.Limit) task.Task
PopByLimit mocks base method.
func (*MockTQueueOnStrategyWithLimit) Push ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) Push(arg0 task.Task) error
Push mocks base method.
func (*MockTQueueOnStrategyWithLimit) ScanTask ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) ScanTask(arg0 func(task.Task))
ScanTask mocks base method.
func (*MockTQueueOnStrategyWithLimit) SetFilterTaskStrategy ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) SetFilterTaskStrategy(arg0 func(task.Task) bool)
SetFilterTaskStrategy mocks base method.
func (*MockTQueueOnStrategyWithLimit) SetRetireTaskStrategy ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) SetRetireTaskStrategy(arg0 func(task.Task) bool)
SetRetireTaskStrategy mocks base method.
func (*MockTQueueOnStrategyWithLimit) TopByLimit ¶ added in v0.2.4
func (m *MockTQueueOnStrategyWithLimit) TopByLimit(arg0 rcmgr.Limit) task.Task
TopByLimit mocks base method.
type MockTQueueOnStrategyWithLimitMockRecorder ¶ added in v0.2.4
type MockTQueueOnStrategyWithLimitMockRecorder struct {
// contains filtered or unexported fields
}
MockTQueueOnStrategyWithLimitMockRecorder is the mock recorder for MockTQueueOnStrategyWithLimit.
func (*MockTQueueOnStrategyWithLimitMockRecorder) Cap ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Cap() *gomock.Call
Cap indicates an expected call of Cap.
func (*MockTQueueOnStrategyWithLimitMockRecorder) Has ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Has(arg0 any) *gomock.Call
Has indicates an expected call of Has.
func (*MockTQueueOnStrategyWithLimitMockRecorder) Len ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len.
func (*MockTQueueOnStrategyWithLimitMockRecorder) PopByKey ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) PopByKey(arg0 any) *gomock.Call
PopByKey indicates an expected call of PopByKey.
func (*MockTQueueOnStrategyWithLimitMockRecorder) PopByLimit ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) PopByLimit(arg0 any) *gomock.Call
PopByLimit indicates an expected call of PopByLimit.
func (*MockTQueueOnStrategyWithLimitMockRecorder) Push ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) Push(arg0 any) *gomock.Call
Push indicates an expected call of Push.
func (*MockTQueueOnStrategyWithLimitMockRecorder) ScanTask ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) ScanTask(arg0 any) *gomock.Call
ScanTask indicates an expected call of ScanTask.
func (*MockTQueueOnStrategyWithLimitMockRecorder) SetFilterTaskStrategy ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) SetFilterTaskStrategy(arg0 any) *gomock.Call
SetFilterTaskStrategy indicates an expected call of SetFilterTaskStrategy.
func (*MockTQueueOnStrategyWithLimitMockRecorder) SetRetireTaskStrategy ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) SetRetireTaskStrategy(arg0 any) *gomock.Call
SetRetireTaskStrategy indicates an expected call of SetRetireTaskStrategy.
func (*MockTQueueOnStrategyWithLimitMockRecorder) TopByLimit ¶ added in v0.2.4
func (mr *MockTQueueOnStrategyWithLimitMockRecorder) TopByLimit(arg0 any) *gomock.Call
TopByLimit indicates an expected call of TopByLimit.
type MockTQueueStrategy ¶ added in v0.2.4
type MockTQueueStrategy struct {
// contains filtered or unexported fields
}
MockTQueueStrategy is a mock of TQueueStrategy interface.
func NewMockTQueueStrategy ¶ added in v0.2.4
func NewMockTQueueStrategy(ctrl *gomock.Controller) *MockTQueueStrategy
NewMockTQueueStrategy creates a new mock instance.
func (*MockTQueueStrategy) EXPECT ¶ added in v0.2.4
func (m *MockTQueueStrategy) EXPECT() *MockTQueueStrategyMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTQueueStrategy) SetFilterTaskStrategy ¶ added in v0.2.4
func (m *MockTQueueStrategy) SetFilterTaskStrategy(arg0 func(task.Task) bool)
SetFilterTaskStrategy mocks base method.
func (*MockTQueueStrategy) SetRetireTaskStrategy ¶ added in v0.2.4
func (m *MockTQueueStrategy) SetRetireTaskStrategy(arg0 func(task.Task) bool)
SetRetireTaskStrategy mocks base method.
type MockTQueueStrategyMockRecorder ¶ added in v0.2.4
type MockTQueueStrategyMockRecorder struct {
// contains filtered or unexported fields
}
MockTQueueStrategyMockRecorder is the mock recorder for MockTQueueStrategy.
func (*MockTQueueStrategyMockRecorder) SetFilterTaskStrategy ¶ added in v0.2.4
func (mr *MockTQueueStrategyMockRecorder) SetFilterTaskStrategy(arg0 any) *gomock.Call
SetFilterTaskStrategy indicates an expected call of SetFilterTaskStrategy.
func (*MockTQueueStrategyMockRecorder) SetRetireTaskStrategy ¶ added in v0.2.4
func (mr *MockTQueueStrategyMockRecorder) SetRetireTaskStrategy(arg0 any) *gomock.Call
SetRetireTaskStrategy indicates an expected call of SetRetireTaskStrategy.
type MockTQueueWithLimit ¶ added in v0.2.4
type MockTQueueWithLimit struct {
// contains filtered or unexported fields
}
MockTQueueWithLimit is a mock of TQueueWithLimit interface.
func NewMockTQueueWithLimit ¶ added in v0.2.4
func NewMockTQueueWithLimit(ctrl *gomock.Controller) *MockTQueueWithLimit
NewMockTQueueWithLimit creates a new mock instance.
func (*MockTQueueWithLimit) Cap ¶ added in v0.2.4
func (m *MockTQueueWithLimit) Cap() int
Cap mocks base method.
func (*MockTQueueWithLimit) EXPECT ¶ added in v0.2.4
func (m *MockTQueueWithLimit) EXPECT() *MockTQueueWithLimitMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTQueueWithLimit) Has ¶ added in v0.2.4
func (m *MockTQueueWithLimit) Has(arg0 task.TKey) bool
Has mocks base method.
func (*MockTQueueWithLimit) Len ¶ added in v0.2.4
func (m *MockTQueueWithLimit) Len() int
Len mocks base method.
func (*MockTQueueWithLimit) PopByKey ¶ added in v0.2.4
func (m *MockTQueueWithLimit) PopByKey(arg0 task.TKey) task.Task
PopByKey mocks base method.
func (*MockTQueueWithLimit) PopByLimit ¶ added in v0.2.4
func (m *MockTQueueWithLimit) PopByLimit(arg0 rcmgr.Limit) task.Task
PopByLimit mocks base method.
func (*MockTQueueWithLimit) Push ¶ added in v0.2.4
func (m *MockTQueueWithLimit) Push(arg0 task.Task) error
Push mocks base method.
func (*MockTQueueWithLimit) ScanTask ¶ added in v0.2.4
func (m *MockTQueueWithLimit) ScanTask(arg0 func(task.Task))
ScanTask mocks base method.
func (*MockTQueueWithLimit) TopByLimit ¶ added in v0.2.4
func (m *MockTQueueWithLimit) TopByLimit(arg0 rcmgr.Limit) task.Task
TopByLimit mocks base method.
type MockTQueueWithLimitMockRecorder ¶ added in v0.2.4
type MockTQueueWithLimitMockRecorder struct {
// contains filtered or unexported fields
}
MockTQueueWithLimitMockRecorder is the mock recorder for MockTQueueWithLimit.
func (*MockTQueueWithLimitMockRecorder) Cap ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) Cap() *gomock.Call
Cap indicates an expected call of Cap.
func (*MockTQueueWithLimitMockRecorder) Has ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) Has(arg0 any) *gomock.Call
Has indicates an expected call of Has.
func (*MockTQueueWithLimitMockRecorder) Len ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) Len() *gomock.Call
Len indicates an expected call of Len.
func (*MockTQueueWithLimitMockRecorder) PopByKey ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) PopByKey(arg0 any) *gomock.Call
PopByKey indicates an expected call of PopByKey.
func (*MockTQueueWithLimitMockRecorder) PopByLimit ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) PopByLimit(arg0 any) *gomock.Call
PopByLimit indicates an expected call of PopByLimit.
func (*MockTQueueWithLimitMockRecorder) Push ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) Push(arg0 any) *gomock.Call
Push indicates an expected call of Push.
func (*MockTQueueWithLimitMockRecorder) ScanTask ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) ScanTask(arg0 any) *gomock.Call
ScanTask indicates an expected call of ScanTask.
func (*MockTQueueWithLimitMockRecorder) TopByLimit ¶ added in v0.2.4
func (mr *MockTQueueWithLimitMockRecorder) TopByLimit(arg0 any) *gomock.Call
TopByLimit indicates an expected call of TopByLimit.
type NewTQueueOnStrategy ¶
type NewTQueueOnStrategy = func(name string, cap int) TQueueOnStrategy
NewTQueueOnStrategy defines the new func type of TQueueOnStrategy
type NewTQueueOnStrategyWithLimit ¶
type NewTQueueOnStrategyWithLimit = func(name string, cap int) TQueueOnStrategyWithLimit
NewTQueueOnStrategyWithLimit the new func type of TQueueOnStrategyWithLimit
type NewTQueueWithLimit ¶
type NewTQueueWithLimit = func(name string, cap int) TQueueWithLimit
NewTQueueWithLimit defines the new func type of TQueueWithLimit
type NilQueue ¶
type NilQueue struct{}
func (*NilQueue) SetFilterTaskStrategy ¶
func (*NilQueue) SetRetireTaskStrategy ¶
type TQueue ¶
type TQueue interface { // Top returns the top task in the queue, if the queue empty, returns nil. Top() task.Task // Pop pops and returns the top task in queue, if the queue empty, returns nil. Pop() task.Task // PopByKey pops the task by the task key, if the task does not exist , returns nil. PopByKey(task.TKey) task.Task // Has returns an indicator whether the task in queue. Has(task.TKey) bool // Push pushes the task in queue tail, if the queue len greater the capacity, returns error. Push(task.Task) error // Len returns the length of queue. Len() int // Cap returns the capacity of queue. Cap() int // ScanTask scans all tasks, and call the func one by one task. ScanTask(func(task.Task)) }
TQueue is the interface to task queue. The task queue is mainly used to maintain tasks are running. In addition to supporting conventional FIFO operations, task queue also has some customized operations for task. For example, Has, PopByKey.
type TQueueOnStrategy ¶
type TQueueOnStrategy interface { TQueue TQueueStrategy }
TQueueOnStrategy is the interface to task queue and the queue supports customize strategies to filter task for popping and retiring task.
type TQueueOnStrategyWithLimit ¶
type TQueueOnStrategyWithLimit interface { TQueueWithLimit TQueueStrategy }
TQueueOnStrategyWithLimit is the interface to task queue that takes resources into account, and the queue supports customize strategies to filter task for popping and retiring task.
type TQueueStrategy ¶
type TQueueStrategy interface { // SetFilterTaskStrategy sets the callback func to filter task for popping or topping. SetFilterTaskStrategy(func(task.Task) bool) // SetRetireTaskStrategy sets the callback func to retire task, when the queue is full, it will be // called to retire tasks. SetRetireTaskStrategy(func(task.Task) bool) }
TQueueStrategy is the interface to queue customize strategies, it supports filter task for popping and retiring task strategies.
type TQueueWithLimit ¶
type TQueueWithLimit interface { // TopByLimit returns the top task that the LimitEstimate less than the param in the queue. TopByLimit(rcmgr.Limit) task.Task // PopByLimit pops and returns the top task that the LimitEstimate less than the param in the queue. PopByLimit(rcmgr.Limit) task.Task // PopByKey pops the task by the task key, if the task does not exist , returns nil. PopByKey(task.TKey) task.Task // Has returns an indicator whether the task in queue. Has(task.TKey) bool // Push pushes the task in queue tail, if the queue len greater the capacity, returns error. Push(task.Task) error // Len returns the length of queue. Len() int // Cap returns the capacity of queue. Cap() int // ScanTask scans all tasks, and call the func one by one task. ScanTask(func(task.Task)) }
TQueueWithLimit is the interface task queue that takes resources into account. Only tasks with less than required resources can be popped out.