def __init__(self,
global_configs=None,
dry_run=False,
concurrent_workers=1,
project_sema=None,
max_running_operations=0):
"""Initialize.
Args:
global_configs (dict): Global configurations.
dry_run (bool): If True, will simply log what action would have been
taken without actually applying any modifications.
concurrent_workers (int): The number of parallel enforcement threads
to execute.
project_sema (threading.BoundedSemaphore): An optional semaphore
object, used to limit the number of concurrent projects getting
written to.
max_running_operations (int): Used to limit the number of concurrent
write operations on a single project's firewall rules. Set to 0 to
allow unlimited in flight asynchronous operations.
"""
self.global_configs = global_configs
self.enforcement_log = enforcer_log_pb2.EnforcerLog()
self._dry_run = dry_run
self._concurrent_workers = concurrent_workers
self._project_sema = project_sema
self._max_running_operations = max_running_operations
self._local = LOCAL_THREAD
batch_enforcer.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录