Documentation ¶
Overview ¶
Copyright © 2020 Marvin
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 © 2020 Marvin ¶
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 © 2020 Marvin ¶
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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPool ¶
type IPool interface { // AddTask adds a task to the pool AddTask(t Task) // Wait waits for all tasks to be dispatched and completed. Wait() // Release releases the pool and all its workers. Release() // RunningWorkerCount returns the number of running workers. RunningWorkerCount() int // GetPoolWorkerCount returns the number of workers. GetPoolWorkerCount() int }
type Option ¶
type Option func(*pool)
Option represents an option for the pool.
func WithExecuteTask ¶
WithExecuteTask sets the task func for the pool.
func WithExecuteTimeout ¶
WithExecuteTimeout sets the timeout for the pool.
func WithResultCallback ¶
WithResultCallback sets the result callback for the pool.
func WithRetryCount ¶
WithRetryCount sets the retry count for the pool.
func WithTaskQueueSize ¶
WithTaskQueueSize sets the size of the task queue for the pool.