towhee.runtime.operator_manager.operator_pool.OperatorPool¶
- class towhee.runtime.operator_manager.operator_pool.OperatorPool[source]¶
Bases:
object
OperatorPool manages Operator creation, acquisition, release, and garbage collection. Each TaskExecutor has one OperatorPool.
Methods
Instruct the OperatorPool to reserve and return the specified operator for use in the executor.
clear
Releases the specified operator and all associated resources back to the OperatorPool.
- acquire_op(key, hub_op_id: str, op_args: List, op_kws: Dict[str, any], tag: str) Operator [source]¶
Instruct the OperatorPool to reserve and return the specified operator for use in the executor.
- Parameters:
key – (str)
hub_op_id – (str)
op_args – (List) Operator init parameters with args
op_kws – (Dict[str, any]) Operator init parameters with kwargs
tag – (str) The tag of operator
- Returns:
- (towhee.operator.Operator)
The operator instance reserved for the caller.