funboost 23.9__py3-none-any.whl → 24.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of funboost might be problematic. Click here for more details.

Files changed (79) hide show
  1. funboost/__init__.py +3 -1
  2. funboost/beggar_version_implementation/beggar_redis_consumer.py +1 -1
  3. funboost/concurrent_pool/flexible_thread_pool.py +140 -0
  4. funboost/consumers/base_consumer.py +2 -4
  5. funboost/consumers/local_python_queue_consumer.py +2 -1
  6. funboost/consumers/rabbitmq_amqpstorm_consumer.py +2 -1
  7. funboost/consumers/rabbitmq_pika_consumerv0.py +1 -0
  8. funboost/consumers/rabbitmq_rabbitpy_consumer.py +2 -1
  9. funboost/core/booster.py +2 -0
  10. funboost/core/get_booster.py +13 -0
  11. funboost/function_result_web/__pycache__/app.cpython-37.pyc +0 -0
  12. funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
  13. funboost/publishers/local_python_queue_publisher.py +1 -1
  14. funboost/publishers/rabbitmq_amqpstorm_publisher.py +1 -1
  15. funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-37.pyc +0 -0
  16. funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-39.pyc +0 -0
  17. funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-311.pyc +0 -0
  18. funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-37.pyc +0 -0
  19. funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc +0 -0
  20. funboost/utils/dependency_packages_in_pythonpath/aioredis/__init__.py +59 -59
  21. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-311.pyc +0 -0
  22. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-37.pyc +0 -0
  23. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-39.pyc +0 -0
  24. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-311.pyc +0 -0
  25. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-37.pyc +0 -0
  26. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-39.pyc +0 -0
  27. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-311.pyc +0 -0
  28. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-37.pyc +0 -0
  29. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-39.pyc +0 -0
  30. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-311.pyc +0 -0
  31. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-37.pyc +0 -0
  32. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-39.pyc +0 -0
  33. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-311.pyc +0 -0
  34. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-37.pyc +0 -0
  35. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-39.pyc +0 -0
  36. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-311.pyc +0 -0
  37. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-37.pyc +0 -0
  38. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-39.pyc +0 -0
  39. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-311.pyc +0 -0
  40. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-37.pyc +0 -0
  41. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-39.pyc +0 -0
  42. funboost/utils/dependency_packages_in_pythonpath/aioredis/client.py +4804 -4804
  43. funboost/utils/dependency_packages_in_pythonpath/aioredis/compat.py +8 -8
  44. funboost/utils/dependency_packages_in_pythonpath/aioredis/connection.py +1668 -1668
  45. funboost/utils/dependency_packages_in_pythonpath/aioredis/exceptions.py +96 -96
  46. funboost/utils/dependency_packages_in_pythonpath/aioredis/lock.py +306 -306
  47. funboost/utils/dependency_packages_in_pythonpath/aioredis/log.py +15 -15
  48. funboost/utils/dependency_packages_in_pythonpath/aioredis/sentinel.py +329 -329
  49. funboost/utils/dependency_packages_in_pythonpath/aioredis/utils.py +61 -61
  50. funboost/utils/dependency_packages_in_pythonpath/func_timeout/StoppableThread.py +133 -133
  51. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__init__.py +16 -16
  52. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-311.pyc +0 -0
  53. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-37.pyc +0 -0
  54. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-39.pyc +0 -0
  55. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-311.pyc +0 -0
  56. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-37.pyc +0 -0
  57. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-39.pyc +0 -0
  58. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-311.pyc +0 -0
  59. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-37.pyc +0 -0
  60. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-39.pyc +0 -0
  61. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-311.pyc +0 -0
  62. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-37.pyc +0 -0
  63. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-39.pyc +0 -0
  64. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-311.pyc +0 -0
  65. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-37.pyc +0 -0
  66. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-39.pyc +0 -0
  67. funboost/utils/dependency_packages_in_pythonpath/func_timeout/dafunc.py +234 -234
  68. funboost/utils/dependency_packages_in_pythonpath/func_timeout/exceptions.py +98 -98
  69. funboost/utils/dependency_packages_in_pythonpath/func_timeout/py2_raise.py +7 -7
  70. funboost/utils/dependency_packages_in_pythonpath/func_timeout/py3_raise.py +7 -7
  71. funboost/utils/times/__init__.py +85 -85
  72. funboost/utils/times/version.py +1 -1
  73. {funboost-23.9.dist-info → funboost-24.2.dist-info}/METADATA +2 -1
  74. {funboost-23.9.dist-info → funboost-24.2.dist-info}/RECORD +77 -49
  75. {funboost-23.9.dist-info → funboost-24.2.dist-info}/WHEEL +5 -5
  76. funboost/utils/kill_thread.py +0 -113
  77. funboost/utils/show_funboost_flag.py +0 -28
  78. {funboost-23.9.dist-info → funboost-24.2.dist-info}/LICENSE +0 -0
  79. {funboost-23.9.dist-info → funboost-24.2.dist-info}/top_level.txt +0 -0
funboost/__init__.py CHANGED
@@ -6,6 +6,8 @@ from funboost.core import show_funboost_flag
6
6
 
7
7
  # noinspection PyUnresolvedReferences
8
8
  import nb_log
9
+ # noinspection PyUnresolvedReferences
10
+ from nb_log import get_logger,nb_print
9
11
  from funboost.set_frame_config import patch_frame_config, show_frame_config
10
12
  from funboost.funboost_config_deafult import BoostDecoratorDefaultParams
11
13
 
@@ -29,7 +31,7 @@ from funboost.timing_job import fsdf_background_scheduler, timing_publish_deco,
29
31
  from funboost.constant import BrokerEnum, ConcurrentModeEnum
30
32
 
31
33
  from funboost.core.booster import boost, Booster
32
- from funboost.core.get_booster import get_booster
34
+ from funboost.core.get_booster import get_booster,get_or_create_booster,get_boost_params_and_consuming_function
33
35
  from funboost.core.kill_remote_task import RemoteTaskKiller
34
36
 
35
37
  from funboost.core.exit_signal import set_interrupt_signal_handler
@@ -58,7 +58,7 @@ def start_consuming_message(queue_name, consume_function, threads_num=50):
58
58
  redis_task = redis_db_frame.brpop(queue_name, timeout=60)
59
59
  if redis_task:
60
60
  task_str = redis_task[1].decode()
61
- print(f'从redis的 {queue_name} 队列中 取出的消息是: {task_str}')
61
+ # print(f'从redis的 {queue_name} 队列中 取出的消息是: {task_str}')
62
62
  pool.submit(consume_function, **json.loads(task_str))
63
63
  else:
64
64
  print(f'redis的 {queue_name} 队列中没有任务')
@@ -0,0 +1,140 @@
1
+ """
2
+ 比更简单的 ThreadPoolExecutorShrinkAble 的弹性线程池,因为 funboost的并发池永远不需要判断代码结束,所以不用 ThreadPoolExecutorShrinkAble 那么复杂来兼容判断并发池要随代码退出而结束循环
3
+ """
4
+
5
+ import asyncio
6
+ import inspect
7
+ import queue
8
+ import threading
9
+ from functools import wraps
10
+
11
+ import nb_log
12
+ from nb_log import LoggerMixin, LoggerLevelSetterMixin
13
+
14
+
15
+ class FlexibleThreadPool(LoggerMixin, LoggerLevelSetterMixin):
16
+ KEEP_ALIVE_TIME = 10
17
+ MIN_WORKERS = 0
18
+
19
+ def __init__(self, max_workers: int = None):
20
+ self.work_queue = queue.Queue(10)
21
+ self.max_workers = max_workers
22
+ self._threads_num = 0
23
+ self.threads_free_count = 0
24
+ self._lock_compute_start_thread = threading.Lock()
25
+ self._lock_compute_threads_free_count = threading.Lock()
26
+ self._lock_for_adjust_thread = threading.Lock()
27
+ self._lock_for_judge_threads_free_count = threading.Lock()
28
+ self.pool_ident = id(self)
29
+ self.asyncio_loop = asyncio.new_event_loop()
30
+
31
+ def _change_threads_free_count(self, change_num):
32
+ with self._lock_compute_threads_free_count:
33
+ self.threads_free_count += change_num
34
+
35
+ def _change_threads_start_count(self, change_num):
36
+ with self._lock_compute_start_thread:
37
+ self._threads_num += change_num
38
+
39
+ def submit(self, func, *args, **kwargs):
40
+ self.work_queue.put([func, args, kwargs])
41
+ with self._lock_for_adjust_thread:
42
+ if self.threads_free_count <= self.MIN_WORKERS and self._threads_num < self.max_workers:
43
+ _KeepAliveTimeThread(self).start()
44
+
45
+
46
+ def run_sync_or_async_fun(func, *args, **kwargs):
47
+ t1 =time.time()
48
+ fun_is_asyncio = inspect.iscoroutinefunction(func)
49
+
50
+ if fun_is_asyncio:
51
+ try:
52
+ loop = asyncio.get_event_loop()
53
+ except RuntimeError:
54
+ loop = asyncio.new_event_loop()
55
+ print(time.time() - t1)
56
+ try:
57
+ result = loop.run_until_complete(func(*args, **kwargs))
58
+
59
+ return result
60
+ finally:
61
+ pass
62
+ # loop.close()
63
+ else:
64
+ return func(*args, **kwargs)
65
+
66
+
67
+ def sync_or_async_fun_deco(func):
68
+ @wraps(func)
69
+ def _inner(*args, **kwargs):
70
+ return run_sync_or_async_fun(func, *args, **kwargs)
71
+
72
+ return _inner
73
+
74
+
75
+ # noinspection PyProtectedMember
76
+ class _KeepAliveTimeThread(threading.Thread):
77
+ logger = nb_log.get_logger('_KeepAliveTimeThread')
78
+
79
+ def __init__(self, thread_pool: FlexibleThreadPool):
80
+ super().__init__()
81
+ self.pool = thread_pool
82
+
83
+ def run(self) -> None:
84
+ self.logger.debug(f'新启动线程 {self.ident} ')
85
+ self.pool._change_threads_free_count(1)
86
+ self.pool._change_threads_start_count(1)
87
+ while 1:
88
+ try:
89
+ func, args, kwargs = self.pool.work_queue.get(block=True, timeout=self.pool.KEEP_ALIVE_TIME)
90
+ except queue.Empty:
91
+
92
+ with self.pool._lock_for_judge_threads_free_count:
93
+ # print(self.pool.threads_free_count)
94
+ if self.pool.threads_free_count > self.pool.MIN_WORKERS:
95
+ self.logger.debug(f'停止线程 {self._ident}, 触发条件是 {self.pool.pool_ident} 线程池中的 {self.ident} 线程 超过 {self.pool.KEEP_ALIVE_TIME} 秒没有任务,线程池中不在工作状态中的线程数量是 {self.pool.threads_free_count},超过了指定的最小核心数量 {self.pool.MIN_WORKERS}') # noqa
96
+ self.pool._change_threads_free_count(-1)
97
+ self.pool._change_threads_start_count(-1)
98
+ break # 退出while 1,即是结束。
99
+ else:
100
+ continue
101
+ self.pool._change_threads_free_count(-1)
102
+ try:
103
+ t1 = time.time()
104
+ fun = sync_or_async_fun_deco(func)
105
+ result = fun(*args, **kwargs)
106
+ print(time.time()-t1)
107
+ # print(result)
108
+ except BaseException as exc:
109
+ self.logger.exception(f'函数 {func.__name__} 中发生错误,错误原因是 {type(exc)} {exc} ')
110
+ self.pool._change_threads_free_count(1)
111
+
112
+
113
+ if __name__ == '__main__':
114
+ import time
115
+ from concurrent.futures import ThreadPoolExecutor
116
+ from custom_threadpool_executor import ThreadPoolExecutorShrinkAble
117
+
118
+
119
+ def testf(x):
120
+ # time.sleep(10)
121
+ if x % 10000 == 0:
122
+ print(x)
123
+
124
+
125
+ async def aiotestf(x):
126
+ # await asyncio.sleep(1)
127
+ # print(x)
128
+ return x * 2
129
+
130
+
131
+ pool = FlexibleThreadPool(100)
132
+ # pool = ThreadPoolExecutor(100)
133
+ # pool = ThreadPoolExecutorShrinkAble(100)
134
+
135
+ for i in range(2000):
136
+ # time.sleep(2)
137
+ pool.submit(aiotestf, i)
138
+
139
+ # for i in range(1000000):
140
+ # pool.submit(testf, i)
@@ -452,8 +452,6 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
452
452
  else:
453
453
  check_not_monkey()
454
454
 
455
- ''' 日志跳转代码行不正确,不用这种方式'''
456
-
457
455
  def _log_error(self, msg, exc_info=None):
458
456
  self.logger.error(msg=f'{msg} \n', exc_info=exc_info, extra={'sys_getframe_n': 3})
459
457
  self.error_file_logger.error(msg=f'{msg} \n', exc_info=exc_info, extra={'sys_getframe_n': 3})
@@ -767,7 +765,7 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
767
765
  avarage_function_spend_time = round(self._consuming_function_cost_time_total_every_unit_time / self._execute_task_times_every_unit_time, 4)
768
766
  msg = f'{self._unit_time_for_count} 秒内执行了 {self._execute_task_times_every_unit_time} 次函数 [ {self.consuming_function.__name__} ] ,' \
769
767
  f'函数平均运行耗时 {avarage_function_spend_time} 秒。 '
770
- self.logger.debug(msg)
768
+ self.logger.info(msg)
771
769
  if self._msg_num_in_broker != -1 and time.time() - self._last_show_remaining_execution_time > self._show_remaining_execution_time_interval: # 有的中间件无法统计或没实现统计队列剩余数量的,统一返回的是-1,不显示这句话。
772
770
  # msg += f''' ,预计还需要 {time_util.seconds_to_hour_minute_second(self._msg_num_in_broker * avarage_function_spend_time / active_consumer_num)} 时间 才能执行完成 {self._msg_num_in_broker}个剩余的任务'''
773
771
  need_time = time_util.seconds_to_hour_minute_second(self._msg_num_in_broker / (self._execute_task_times_every_unit_time / self._unit_time_for_count) /
@@ -915,7 +913,7 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
915
913
  avarage_function_spend_time = round(self._consuming_function_cost_time_total_every_unit_time / self._execute_task_times_every_unit_time, 4)
916
914
  msg = f'{self._unit_time_for_count} 秒内执行了 {self._execute_task_times_every_unit_time} 次函数 [ {self.consuming_function.__name__} ] ,' \
917
915
  f'函数平均运行耗时 {avarage_function_spend_time} 秒。 '
918
- self.logger.debug(msg)
916
+ self.logger.info(msg)
919
917
  if self._msg_num_in_broker != -1 and time.time() - self._last_show_remaining_execution_time > self._show_remaining_execution_time_interval: # 有的中间件无法统计或没实现统计队列剩余数量的,统一返回的是-1,不显示这句话。
920
918
  # msg += f''' ,预计还需要 {time_util.seconds_to_hour_minute_second(self._msg_num_in_broker * avarage_function_spend_time / active_consumer_num)} 时间 才能执行完成 {self._msg_num_in_broker}个剩余的任务'''
921
919
  need_time = time_util.seconds_to_hour_minute_second(self._msg_num_in_broker / (self._execute_task_times_every_unit_time / self._unit_time_for_count) /
@@ -14,7 +14,7 @@ class LocalPythonQueueConsumer(AbstractConsumer):
14
14
  """
15
15
 
16
16
  @property
17
- def local_python_queue(self) -> SimpleQueue:
17
+ def local_python_queue(self) -> Queue:
18
18
  return local_python_queue_publisher.local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name]
19
19
 
20
20
  def _shedual_task(self):
@@ -32,3 +32,4 @@ class LocalPythonQueueConsumer(AbstractConsumer):
32
32
 
33
33
  def _requeue(self, kw):
34
34
  self.local_python_queue.put(kw['body'])
35
+
@@ -29,7 +29,8 @@ class RabbitmqConsumerAmqpStorm(AbstractConsumer):
29
29
  rp = RabbitmqPublisherUsingAmqpStorm(self.queue_name,broker_exclusive_config=self.broker_exclusive_config)
30
30
  rp.init_broker()
31
31
  rp.channel_wrapper_by_ampqstormbaic.qos(self._concurrent_num)
32
- rp.channel_wrapper_by_ampqstormbaic.consume(callback=callback, queue=self.queue_name, no_ack=False,)
32
+ rp.channel_wrapper_by_ampqstormbaic.consume(callback=callback, queue=self.queue_name, no_ack=False,
33
+ )
33
34
  rp.channel.start_consuming(auto_decode=True)
34
35
 
35
36
  def _confirm_consume(self, kw):
@@ -25,6 +25,7 @@ class RabbitmqConsumer(AbstractConsumer):
25
25
  # noinspection PyAttributeOutsideInit
26
26
  def custom_init(self):
27
27
  self._lock_for_pika = Lock()
28
+ raise Exception('不建议使用这个中间件模式,建议使用 BrokerEnum.RABBITMQ_AMQPSTORM 操作rabbitmq')
28
29
 
29
30
  def _shedual_task(self):
30
31
  # channel = RabbitMqFactory(is_use_rabbitpy=0).get_rabbit_cleint().creat_a_channel()
@@ -12,7 +12,8 @@ class RabbitmqConsumerRabbitpy(AbstractConsumer):
12
12
  """
13
13
  使用rabbitpy实现的
14
14
  """
15
-
15
+ def custom_init(self):
16
+ raise Exception('不建议使用这个中间件模式,建议使用 BrokerEnum.RABBITMQ_AMQPSTORM 操作rabbitmq')
16
17
 
17
18
  def _shedual_task(self):
18
19
  # noinspection PyTypeChecker
funboost/core/booster.py CHANGED
@@ -21,6 +21,8 @@ class Booster:
21
21
  funboost极其重视代码能在pycharm下自动补全。元编程经常造成在pycharm下代码无法自动补全提示,要是实现代码补全难。
22
22
  这种__call__写法在pycahrm下 不仅能补全消费函数的 push consume等方法,也能补全函数本身的入参,一举两得。代码能自动补全很重要。
23
23
  一个函数fun被 boost装饰器装饰后, isinstance(fun,Booster) 为True.
24
+
25
+ Booster 是把Consumer 和 Publisher的方法集为一体。
24
26
  """
25
27
 
26
28
  def __init__(self, queue_name,
@@ -23,3 +23,16 @@ def get_boost_params_and_consuming_function(queue_name: str) -> (dict, typing.Ca
23
23
  booster_current_pid = boost(**boost_params)(consuming_function)
24
24
  """
25
25
  return queue_name__boost_params_consuming_function_map[queue_name]
26
+
27
+
28
+ def get_or_create_booster(queue_name, consuming_function, **boost_params, ) -> Booster:
29
+ """
30
+ 当前进程获得或者创建booster对象。方便有的人需要在函数内部临时动态根据队列名创建booster,不会无数次临时生成消费者、生产者、创建消息队列连接。
31
+ :param boost_params: 就是 Booster的入参。
32
+ :return:
33
+ """
34
+ try:
35
+ return get_booster(queue_name)
36
+ except ValueError: # 不存在就创建。
37
+ boost_params['queue_name'] = queue_name
38
+ return Booster(**boost_params)(consuming_function)
@@ -16,7 +16,7 @@ class LocalPythonQueuePublisher(AbstractPublisher):
16
16
  # noinspection PyAttributeOutsideInit
17
17
  def custom_init(self):
18
18
  if self._queue_name not in local_pyhton_queue_name__local_pyhton_queue_obj_map:
19
- local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name] = SimpleQueue()
19
+ local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name] = Queue(10000)
20
20
  self.queue = local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name]
21
21
 
22
22
  def concrete_realization_of_publish(self, msg):
@@ -19,7 +19,7 @@ class RabbitmqPublisherUsingAmqpStorm(AbstractPublisher):
19
19
  DURABLE = True
20
20
 
21
21
  def custom_init(self):
22
- arguments = {}
22
+ arguments = {} # {'x-queue-type':'classic'} classic stream lazy quorum
23
23
  if self.broker_exclusive_config['x-max-priority']:
24
24
  arguments['x-max-priority'] = self.broker_exclusive_config['x-max-priority']
25
25
  self.queue_declare_params = dict(queue=self._queue_name, durable=self.DURABLE, arguments=arguments,auto_delete=False)
@@ -1,59 +1,59 @@
1
- from aioredis.client import Redis, StrictRedis
2
- from aioredis.connection import (
3
- BlockingConnectionPool,
4
- Connection,
5
- ConnectionPool,
6
- SSLConnection,
7
- UnixDomainSocketConnection,
8
- )
9
- from aioredis.exceptions import (
10
- AuthenticationError,
11
- AuthenticationWrongNumberOfArgsError,
12
- BusyLoadingError,
13
- ChildDeadlockedError,
14
- ConnectionError,
15
- DataError,
16
- InvalidResponse,
17
- PubSubError,
18
- ReadOnlyError,
19
- RedisError,
20
- ResponseError,
21
- TimeoutError,
22
- WatchError,
23
- )
24
- from aioredis.utils import from_url
25
-
26
-
27
- def int_or_str(value):
28
- try:
29
- return int(value)
30
- except ValueError:
31
- return value
32
-
33
-
34
- __version__ = "2.0.1"
35
- VERSION = tuple(map(int_or_str, __version__.split(".")))
36
-
37
- __all__ = [
38
- "AuthenticationError",
39
- "AuthenticationWrongNumberOfArgsError",
40
- "BlockingConnectionPool",
41
- "BusyLoadingError",
42
- "ChildDeadlockedError",
43
- "Connection",
44
- "ConnectionError",
45
- "ConnectionPool",
46
- "DataError",
47
- "from_url",
48
- "InvalidResponse",
49
- "PubSubError",
50
- "ReadOnlyError",
51
- "Redis",
52
- "RedisError",
53
- "ResponseError",
54
- "SSLConnection",
55
- "StrictRedis",
56
- "TimeoutError",
57
- "UnixDomainSocketConnection",
58
- "WatchError",
59
- ]
1
+ from aioredis.client import Redis, StrictRedis
2
+ from aioredis.connection import (
3
+ BlockingConnectionPool,
4
+ Connection,
5
+ ConnectionPool,
6
+ SSLConnection,
7
+ UnixDomainSocketConnection,
8
+ )
9
+ from aioredis.exceptions import (
10
+ AuthenticationError,
11
+ AuthenticationWrongNumberOfArgsError,
12
+ BusyLoadingError,
13
+ ChildDeadlockedError,
14
+ ConnectionError,
15
+ DataError,
16
+ InvalidResponse,
17
+ PubSubError,
18
+ ReadOnlyError,
19
+ RedisError,
20
+ ResponseError,
21
+ TimeoutError,
22
+ WatchError,
23
+ )
24
+ from aioredis.utils import from_url
25
+
26
+
27
+ def int_or_str(value):
28
+ try:
29
+ return int(value)
30
+ except ValueError:
31
+ return value
32
+
33
+
34
+ __version__ = "2.0.1"
35
+ VERSION = tuple(map(int_or_str, __version__.split(".")))
36
+
37
+ __all__ = [
38
+ "AuthenticationError",
39
+ "AuthenticationWrongNumberOfArgsError",
40
+ "BlockingConnectionPool",
41
+ "BusyLoadingError",
42
+ "ChildDeadlockedError",
43
+ "Connection",
44
+ "ConnectionError",
45
+ "ConnectionPool",
46
+ "DataError",
47
+ "from_url",
48
+ "InvalidResponse",
49
+ "PubSubError",
50
+ "ReadOnlyError",
51
+ "Redis",
52
+ "RedisError",
53
+ "ResponseError",
54
+ "SSLConnection",
55
+ "StrictRedis",
56
+ "TimeoutError",
57
+ "UnixDomainSocketConnection",
58
+ "WatchError",
59
+ ]