funboost 45.8__py3-none-any.whl → 45.9__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.

funboost/__init__.py CHANGED
@@ -13,7 +13,7 @@ set_frame_config这个模块的 use_config_form_funboost_config_module() 是核
13
13
  这段注释说明和使用的用户无关,只和框架开发人员有关.
14
14
  '''
15
15
 
16
- __version__ = "45.8"
16
+ __version__ = "45.9"
17
17
 
18
18
  from funboost.set_frame_config import show_frame_config
19
19
 
@@ -99,7 +99,7 @@ class ThreadPoolExecutorShrinkAble(Executor, FunboostFileLoggerMixin, LoggerLeve
99
99
  MIN_WORKERS = 5
100
100
  KEEP_ALIVE_TIME = 60
101
101
 
102
- def __init__(self, max_workers: int = None, thread_name_prefix=''):
102
+ def __init__(self, max_workers: int = None, thread_name_prefix='',work_queue_maxsize=10):
103
103
  """
104
104
  最好需要兼容官方concurren.futures.ThreadPoolExecutor 和改版的BoundedThreadPoolExecutor,入参名字和个数保持了一致。
105
105
  :param max_workers:
@@ -110,7 +110,7 @@ class ThreadPoolExecutorShrinkAble(Executor, FunboostFileLoggerMixin, LoggerLeve
110
110
  self._thread_name_prefix = thread_name_prefix
111
111
  # print(self._max_workers)
112
112
  # self.work_queue = self._work_queue = queue.Queue(self._max_workers or 10)
113
- self.work_queue = self._work_queue = queue.Queue(10)
113
+ self.work_queue = self._work_queue = queue.Queue(work_queue_maxsize)
114
114
  # self._threads = set()
115
115
  self._threads = weakref.WeakSet()
116
116
  self._lock_compute_threads_free_count = threading.Lock()
@@ -23,8 +23,8 @@ class FlexibleThreadPool(FunboostFileLoggerMixin, LoggerLevelSetterMixin, Funboo
23
23
  KEEP_ALIVE_TIME = 10
24
24
  MIN_WORKERS = 2
25
25
 
26
- def __init__(self, max_workers: int = None):
27
- self.work_queue = queue.Queue(10)
26
+ def __init__(self, max_workers: int = None,work_queue_maxsize=10):
27
+ self.work_queue = queue.Queue(work_queue_maxsize)
28
28
  self.max_workers = max_workers
29
29
  self._threads_num = 0
30
30
  self.threads_free_count = 0
@@ -20,13 +20,27 @@ NO_RESULT = 'no_result'
20
20
 
21
21
 
22
22
  class AsyncResult(RedisMixin):
23
- callback_run_executor = FlexibleThreadPoolMinWorkers0(200)
23
+ default_callback_run_executor = FlexibleThreadPoolMinWorkers0(200,work_queue_maxsize=10000)
24
+
25
+ @property
26
+ def callback_run_executor(self, ):
27
+ return self._callback_run_executor or self.default_callback_run_executor
28
+ @callback_run_executor.setter
29
+ def callback_run_executor(self,thread_pool_executor):
30
+ """
31
+ 用户可以 async_result.callback_run_executor = 你自己的线程池
32
+ thread_pool_executor 用户可以传递 FlexibleThreadPool或者 ThreadPoolExecutorShrinkAble 或者官方的 concurrent.futures.ThreadPoolExecutor 类型的对象都可以,任意线程池只要实现了submit方法即可。
33
+ :param thread_pool_executor:
34
+ :return:
35
+ """
36
+ self._callback_run_executor = thread_pool_executor
24
37
 
25
38
  def __init__(self, task_id, timeout=120):
26
39
  self.task_id = task_id
27
40
  self.timeout = timeout
28
41
  self._has_pop = False
29
42
  self._status_and_result = None
43
+ self._callback_run_executor = None
30
44
 
31
45
  def set_timeout(self, timeout=60):
32
46
  self.timeout = timeout
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: funboost
3
- Version: 45.8
3
+ Version: 45.9
4
4
  Summary: pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和一切知名消息队列中间件,支持如 celery dramatiq等框架整体作为funboost中间件,python函数加速器,框架包罗万象,用户能想到的控制功能全都有。一统编程思维,兼容50% python业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数,99%用过funboost的pythoner 感受是 简易 方便 强劲 强大,相见恨晚
5
5
  Home-page: https://github.com/ydf0509/funboost
6
6
  Author: bfzs
@@ -1,4 +1,4 @@
1
- funboost/__init__.py,sha256=o279AThQ5IgWdA9MFpV7UJuI3FFbDke2Gk-jbUKA-Qk,3956
1
+ funboost/__init__.py,sha256=YPO9Fpdg7PbeRT9yMdb_9wRxZAE0rlAuDe_x--0UlTw,3956
2
2
  funboost/__init__old.py,sha256=9Kv3cPLnPkbzMRnuJFVkPsuDdx1CdcSIuITkpdncZSc,20382
3
3
  funboost/__main__.py,sha256=-6Nogi666Y0LN8fVm3JmHGTOk8xEGWvotW_GDbSaZME,1065
4
4
  funboost/constant.py,sha256=STzRDZbuCC5FFV-uD_0r2beGsD1Zni4kregzR11z3Ok,8148
@@ -24,10 +24,10 @@ funboost/concurrent_pool/bounded_threadpoolexcutor.py,sha256=AWFsTwK7hIiln0XVaiY
24
24
  funboost/concurrent_pool/concurrent_pool_with_multi_process.py,sha256=qChdRh11Epk7-kmLEdoB1TtM2plx_FZ1u_-g0KNc-MU,1744
25
25
  funboost/concurrent_pool/custom_evenlet_pool_executor.py,sha256=tu8Og-uIt5VWqGERnIihBaF7ZFw5D0xww1_ur39OZXY,3252
26
26
  funboost/concurrent_pool/custom_gevent_pool_executor.py,sha256=FLcEwEJgFtaEPzH-WCFHtCdEUOTeK0dLSL_oNBcXQW8,5429
27
- funboost/concurrent_pool/custom_threadpool_executor.py,sha256=i3OGtOjk5GOGvGjEMdYVzFVscSVPRFWmEe1yZeZLsCQ,11872
27
+ funboost/concurrent_pool/custom_threadpool_executor.py,sha256=pITxs1S7V2uQkIcwocLSFWTfAlV6QqET8qmIbho0si4,11910
28
28
  funboost/concurrent_pool/custom_threadpool_executor000.py,sha256=jJLXy3h-bELap6nZA6yLtdozzTWcvCtZ7IY6MTqLEAM,9317
29
29
  funboost/concurrent_pool/fixed_thread_pool.py,sha256=JzaqjuHn6ffo1gZRVJEy5Te5NdCJt7heTmsVZT_AiBg,1609
30
- funboost/concurrent_pool/flexible_thread_pool.py,sha256=k5CUoT5S3ZQ973y62hRHYy_WGRN1-U89-Pt9oB4Hwb8,6002
30
+ funboost/concurrent_pool/flexible_thread_pool.py,sha256=-xvRYcSzh-oNVtDkEsMreRPW6sadQ6PFsN35XzLOdAU,6040
31
31
  funboost/concurrent_pool/pool_commons.py,sha256=oJjVeJyUfN7ErYbm7tXXHn2rRzASxLufmSUb9c14IGQ,866
32
32
  funboost/concurrent_pool/single_thread_executor.py,sha256=rRrqDGmJxxtKBUxigUl1WATLXTGODpmtNoVOF8vRt_w,468
33
33
  funboost/concurrent_pool/backup/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -99,7 +99,7 @@ funboost/core/helper_funs.py,sha256=Jzy6t4-cugI-tOztgt7DGSos3tkxk2R4IOUOK2OWJ-I,
99
99
  funboost/core/kill_remote_task.py,sha256=MZ5vWLGt6SxyN76h5Lf_id9tyVUzjR-qXNyJwXaGlZY,8129
100
100
  funboost/core/lazy_impoter.py,sha256=5yToRBbTB338heR787ap5i-UAGN0FanUCkYfK9Nsgnk,4957
101
101
  funboost/core/loggers.py,sha256=uy5mFLIUvKaVdJZLi6THyxqeuOmp9XEOKrH1Yci0zUM,2354
102
- funboost/core/msg_result_getter.py,sha256=wxJBTOsyPDptLbNYOIA7YwuDsDUKDpB5sFzj9_HPcPs,8106
102
+ funboost/core/msg_result_getter.py,sha256=FggZDh4QXdIqhjwY79FYPp1lPNrUq9_Xh0FVmjA4Kk8,8875
103
103
  funboost/core/muliti_process_enhance.py,sha256=tI3178inc5sqPh-jQc0XaTuUD1diIZyHuukBRk1Gp6Y,3595
104
104
  funboost/core/serialization.py,sha256=Q6cAfbaqBCKw0AQwisbMNjOOD0csq0xdes5BHn1Nelo,412
105
105
  funboost/core/task_id_logger.py,sha256=lR19HQcX6Pp8laURCD656xNpF_JP6nLB3zUKI69EWzE,864
@@ -277,9 +277,9 @@ funboost/utils/pysnooper_ydf/utils.py,sha256=evSmGi_Oul7vSP47AJ0DLjFwoCYCfunJZ1m
277
277
  funboost/utils/pysnooper_ydf/variables.py,sha256=QejRDESBA06KG9OH4sBT4J1M55eaU29EIHg8K_igaXo,3693
278
278
  funboost/utils/times/__init__.py,sha256=Y4bQD3SIA_E7W2YvHq2Qdi0dGM4H2DxyFNdDOuFOq1w,2417
279
279
  funboost/utils/times/version.py,sha256=11XfnZVVzOgIhXXdeN_mYfdXThfrsbQHpA0wCjz-hpg,17
280
- funboost-45.8.dist-info/LICENSE,sha256=9EPP2ktG_lAPB8PjmWV-c9BiaJHc_FP6pPLcUrUwx0E,11562
281
- funboost-45.8.dist-info/METADATA,sha256=edeZafad3uQB17Trwjd8lCQ1RVbSHtN_5qhccutvmqI,32536
282
- funboost-45.8.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
283
- funboost-45.8.dist-info/entry_points.txt,sha256=BQMqRALuw-QT9x2d7puWaUHriXfy3wIzvfzF61AnSSI,97
284
- funboost-45.8.dist-info/top_level.txt,sha256=K8WuKnS6MRcEWxP1NvbmCeujJq6TEfbsB150YROlRw0,9
285
- funboost-45.8.dist-info/RECORD,,
280
+ funboost-45.9.dist-info/LICENSE,sha256=9EPP2ktG_lAPB8PjmWV-c9BiaJHc_FP6pPLcUrUwx0E,11562
281
+ funboost-45.9.dist-info/METADATA,sha256=cMe0AWgidDnjSLGFrABJXWguu_uRZUoTRGa7_lhGahM,32536
282
+ funboost-45.9.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
283
+ funboost-45.9.dist-info/entry_points.txt,sha256=BQMqRALuw-QT9x2d7puWaUHriXfy3wIzvfzF61AnSSI,97
284
+ funboost-45.9.dist-info/top_level.txt,sha256=K8WuKnS6MRcEWxP1NvbmCeujJq6TEfbsB150YROlRw0,9
285
+ funboost-45.9.dist-info/RECORD,,