Documentation ¶
Overview ¶
Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2019 Huawei Technologies Co.,Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Variables
- type Future
- type FutureResult
- type NoChanPool
- func (pool *NoChanPool) AddCurrentWorkingCnt(value int64) int64
- func (pool *NoChanPool) AddMaxWorkerCnt(value int64) int64
- func (pool *NoChanPool) AddWorkerCnt(value int64) int64
- func (pool *NoChanPool) CompareAndSwapCurrentWorkingCnt(oldValue, newValue int64) bool
- func (pool *NoChanPool) EnableAutoTune()
- func (pool *NoChanPool) Execute(t Task)
- func (pool *NoChanPool) ExecuteFunc(f func() interface{})
- func (pool *NoChanPool) GetCurrentWorkingCnt() int64
- func (pool *NoChanPool) GetMaxWorkerCnt() int64
- func (pool *NoChanPool) GetWorkerCnt() int64
- func (pool *NoChanPool) ShutDown()
- func (pool *NoChanPool) Submit(t Task) (Future, error)
- func (pool *NoChanPool) SubmitFunc(f func() interface{}) (Future, error)
- type Pool
- type RoutinePool
- func (pool *RoutinePool) AddCurrentWorkingCnt(value int64) int64
- func (pool *RoutinePool) AddMaxWorkerCnt(value int64) int64
- func (pool *RoutinePool) AddWorkerCnt(value int64) int64
- func (pool *RoutinePool) CompareAndSwapCurrentWorkingCnt(oldValue, newValue int64) bool
- func (pool *RoutinePool) EnableAutoTune()
- func (pool *RoutinePool) Execute(t Task)
- func (pool *RoutinePool) ExecuteFunc(f func() interface{})
- func (pool *RoutinePool) GetCurrentWorkingCnt() int64
- func (pool *RoutinePool) GetMaxWorkerCnt() int64
- func (pool *RoutinePool) GetWorkerCnt() int64
- func (pool *RoutinePool) ShutDown()
- func (pool *RoutinePool) Submit(t Task) (Future, error)
- func (pool *RoutinePool) SubmitFunc(f func() interface{}) (Future, error)
- func (pool *RoutinePool) SubmitWithTimeout(t Task, timeout int64) (Future, error)
- type Task
Constants ¶
This section is empty.
Variables ¶
var ErrPoolShutDown = errors.New("RoutinePool is shutdown")
var ErrSubmitTimeout = errors.New("Submit task timeout")
var ErrTaskInvalid = errors.New("Task is nil")
var ErrTaskReject = errors.New("Submit task is rejected")
Functions ¶
This section is empty.
Types ¶
type FutureResult ¶
type FutureResult struct {
// contains filtered or unexported fields
}
func (*FutureResult) Get ¶
func (f *FutureResult) Get() interface{}
type NoChanPool ¶
type NoChanPool struct {
// contains filtered or unexported fields
}
func (*NoChanPool) AddCurrentWorkingCnt ¶
func (*NoChanPool) AddMaxWorkerCnt ¶
func (*NoChanPool) AddWorkerCnt ¶
func (*NoChanPool) CompareAndSwapCurrentWorkingCnt ¶
func (*NoChanPool) EnableAutoTune ¶
func (pool *NoChanPool) EnableAutoTune()
func (*NoChanPool) Execute ¶
func (pool *NoChanPool) Execute(t Task)
func (*NoChanPool) ExecuteFunc ¶
func (pool *NoChanPool) ExecuteFunc(f func() interface{})
func (*NoChanPool) GetCurrentWorkingCnt ¶
func (pool *NoChanPool) GetCurrentWorkingCnt() int64
func (*NoChanPool) GetMaxWorkerCnt ¶
func (pool *NoChanPool) GetMaxWorkerCnt() int64
func (*NoChanPool) GetWorkerCnt ¶
func (pool *NoChanPool) GetWorkerCnt() int64
func (*NoChanPool) ShutDown ¶
func (pool *NoChanPool) ShutDown()
func (*NoChanPool) SubmitFunc ¶
func (pool *NoChanPool) SubmitFunc(f func() interface{}) (Future, error)
type Pool ¶
type Pool interface { ShutDown() Submit(t Task) (Future, error) SubmitFunc(f func() interface{}) (Future, error) Execute(t Task) ExecuteFunc(f func() interface{}) GetMaxWorkerCnt() int64 AddMaxWorkerCnt(value int64) int64 GetCurrentWorkingCnt() int64 AddCurrentWorkingCnt(value int64) int64 GetWorkerCnt() int64 AddWorkerCnt(value int64) int64 EnableAutoTune() }
func NewNochanPool ¶
func NewRoutinePool ¶
type RoutinePool ¶
type RoutinePool struct {
// contains filtered or unexported fields
}
func (*RoutinePool) AddCurrentWorkingCnt ¶
func (*RoutinePool) AddMaxWorkerCnt ¶
func (pool *RoutinePool) AddMaxWorkerCnt(value int64) int64
func (*RoutinePool) AddWorkerCnt ¶
func (*RoutinePool) CompareAndSwapCurrentWorkingCnt ¶
func (*RoutinePool) EnableAutoTune ¶
func (pool *RoutinePool) EnableAutoTune()
func (*RoutinePool) Execute ¶
func (pool *RoutinePool) Execute(t Task)
func (*RoutinePool) ExecuteFunc ¶
func (pool *RoutinePool) ExecuteFunc(f func() interface{})
func (*RoutinePool) GetCurrentWorkingCnt ¶
func (pool *RoutinePool) GetCurrentWorkingCnt() int64
func (*RoutinePool) GetMaxWorkerCnt ¶
func (pool *RoutinePool) GetMaxWorkerCnt() int64
func (*RoutinePool) GetWorkerCnt ¶
func (pool *RoutinePool) GetWorkerCnt() int64
func (*RoutinePool) ShutDown ¶
func (pool *RoutinePool) ShutDown()
func (*RoutinePool) SubmitFunc ¶
func (pool *RoutinePool) SubmitFunc(f func() interface{}) (Future, error)
func (*RoutinePool) SubmitWithTimeout ¶
func (pool *RoutinePool) SubmitWithTimeout(t Task, timeout int64) (Future, error)