funboost 30.2__tar.gz → 30.4__tar.gz
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-30.2/funboost.egg-info → funboost-30.4}/PKG-INFO +2 -2
- {funboost-30.2 → funboost-30.4}/README.md +1 -1
- {funboost-30.2 → funboost-30.4}/funboost/__init__.py +2 -1
- {funboost-30.2 → funboost-30.4}/funboost/assist/celery_helper.py +2 -2
- {funboost-30.2 → funboost-30.4}/funboost/constant.py +4 -2
- {funboost-30.2 → funboost-30.4}/funboost/consumers/base_consumer.py +13 -9
- {funboost-30.2 → funboost-30.4}/funboost/consumers/confirm_mixin.py +1 -1
- funboost-30.4/funboost/consumers/memory_deque_consumer.py +35 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_filter.py +2 -1
- funboost-30.4/funboost/contrib/api_publish_msg.py +54 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/booster.py +5 -2
- {funboost-30.2 → funboost-30.4}/funboost/core/cli/funboost_fire.py +15 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/msg_result_getter.py +2 -0
- {funboost-30.2 → funboost-30.4}/funboost/factories/broker_kind__publsiher_consumer_type_map.py +4 -2
- {funboost-30.2 → funboost-30.4}/funboost/funboost_config_deafult.py +5 -6
- funboost-30.4/funboost/function_result_web/__pycache__/app.cpython-37.pyc +0 -0
- funboost-30.4/funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/app.py +1 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/base_publisher.py +0 -1
- {funboost-30.2 → funboost-30.4}/funboost/publishers/celery_publisher.py +1 -0
- funboost-30.4/funboost/publishers/local_python_queue_publisher.py +95 -0
- funboost-30.4/funboost/publishers/meomory_deque_publisher.py +36 -0
- {funboost-30.2 → funboost-30.4}/funboost/timing_job/__init__.py +9 -7
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-37.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-37.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__init__.py +59 -59
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-37.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-39.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/client.py +4804 -4804
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/compat.py +8 -8
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/connection.py +1668 -1668
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/exceptions.py +96 -96
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/lock.py +306 -306
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/log.py +15 -15
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/aioredis/py.typed +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/sentinel.py +329 -329
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/utils.py +61 -61
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/StoppableThread.py +133 -133
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__init__.py +16 -16
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-39.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-311.pyc +0 -0
- funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-37.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-39.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/dafunc.py +234 -234
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/exceptions.py +98 -98
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/py2_raise.py +7 -7
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/py3_raise.py +7 -7
- {funboost-30.2 → funboost-30.4}/funboost/utils/redis_manager.py +3 -1
- {funboost-30.2 → funboost-30.4}/funboost/utils/simple_data_class.py +6 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/times/__init__.py +85 -85
- {funboost-30.2 → funboost-30.4}/funboost/utils/times/version.py +1 -1
- {funboost-30.2 → funboost-30.4/funboost.egg-info}/PKG-INFO +2 -2
- {funboost-30.2 → funboost-30.4}/funboost.egg-info/SOURCES.txt +33 -1
- funboost-30.2/funboost/consumers/celery_consumer000.py +0 -122
- funboost-30.2/funboost/publishers/local_python_queue_publisher.py +0 -35
- funboost-30.2/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost-30.2/funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc +0 -0
- funboost-30.2/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-39.pyc +0 -0
- {funboost-30.2 → funboost-30.4}/LICENSE +0 -0
- {funboost-30.2 → funboost-30.4}/MANIFEST.in +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/__init__old.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/__main__.py +0 -0
- {funboost-30.2/funboost/concurrent_pool/backup → funboost-30.4/funboost/assist}/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/assist/dramatiq_helper.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/assist/huey_helper.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/assist/rocketry_helper.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/assist/rq_helper.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/assist/rq_windows_worker.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/beggar_version_implementation/beggar_redis_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/async_helper.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/async_pool_executor.py +0 -0
- {funboost-30.2/funboost/contrib → funboost-30.4/funboost/concurrent_pool/backup}/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/backup/async_pool_executor0223.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/backup/async_pool_executor_back.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/backup/async_pool_executor_janus.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/bounded_processpoolexcutor_gt_py37.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/bounded_processpoolexcutor_py36.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/bounded_threadpoolexcutor.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/concurrent_pool_with_multi_process.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/custom_evenlet_pool_executor.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/custom_gevent_pool_executor.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/custom_threadpool_executor.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/custom_threadpool_executor000.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/fixed_thread_pool.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/flexible_thread_pool.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/concurrent_pool/single_thread_executor.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/celery_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/dramatiq_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/http_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/http_consumer000.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/httpsqs_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/huey_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/kafka_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/kafka_consumer_manually_commit.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/kombu_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/local_python_queue_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/mongomq_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/mqtt_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/nameko_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/nats_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/nsq_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/peewee_conusmer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/persist_queue_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/pulsar_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/rabbitmq_amqpstorm_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/rabbitmq_pika_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/rabbitmq_pika_consumerv0.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/rabbitmq_rabbitpy_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_brpoplpush_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_consumer_ack_able.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_consumer_priority.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_consumer_simple.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_pubsub_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/redis_stream_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/rocketmq_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/rq_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/sqlachemy_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/tcp_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/txt_file_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/udp_consumer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/consumers/zeromq_consumer.py +0 -0
- {funboost-30.2/funboost/core → funboost-30.4/funboost/contrib}/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/contrib/queue2queue.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/contrib/redis_consume_latest_msg_broker.py +0 -0
- {funboost-30.2/funboost/core/cli → funboost-30.4/funboost/core}/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/active_cousumer_info_getter.py +0 -0
- {funboost-30.2/funboost/queues → funboost-30.4/funboost/core/cli}/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/cli/discovery_boosters.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/cli/funboost_cli_user_templ.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/fabric_deploy_helper.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/function_result_status_config.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/function_result_status_saver.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/get_booster.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/global_boosters.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/helper_funs.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/kill_remote_task.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/muliti_process_enhance.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/core/show_funboost_flag.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/factories/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/factories/consumer_factory.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/factories/publisher_factotry.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/functions.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/assets/css/custom.css +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/assets/css/jquery.mCustomScrollbar.min.css +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/assets/img/user.jpg +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/assets/js/custom.js +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/assets/js/jquery.mCustomScrollbar.concat.min.js +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/css/style.css +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/images/bg.jpg +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/images/password.png +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/images/tick.png +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/images/user.png +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/static/js/jquery-1.11.0.min.js +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/templates/index.html +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/function_result_web/templates/login.html +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/celery_publisher000.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/confluent_kafka_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/dramatiq_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/http_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/httpsqs_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/huey_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/kafka_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/kombu_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/mongomq_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/mqtt_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/nameko_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/nats_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/nsq_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/peewee_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/persist_queue_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/pulsar_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/rabbitmq_amqpstorm_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/rabbitmq_pika_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/rabbitmq_rabbitpy_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/redis_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/redis_publisher_lpush.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/redis_publisher_priority.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/redis_publisher_simple.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/redis_pubsub_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/redis_queue_flush_mixin.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/redis_stream_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/rocketmq_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/rq_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/sqla_queue_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/tcp_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/txt_file_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/udp_publisher.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/publishers/zeromq_publisher.py +0 -0
- {funboost-30.2/funboost/utils/dependency_packages → funboost-30.4/funboost/queues}/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/queues/peewee_queue.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/queues/sqla_queue.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/set_frame_config.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/timing_job/apscheduler_use_mysql_store.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/timing_job/apscheduler_use_redis_store.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/apscheduler_monkey.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/block_exit.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/bulk_operation.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/ctrl_c_end.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/custom_pysnooper.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/decorators.py +0 -0
- {funboost-30.2/funboost/utils/dependency_packages_in_pythonpath → funboost-30.4/funboost/utils/dependency_packages}/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages/mongomq/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages/mongomq/lock.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages/mongomq/mongomq.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages/mongomq/mongomq0000.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages/mongomq/test.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages/mongomq/utils.py +0 -0
- /funboost-30.2/funboost/utils/dependency_packages_in_pythonpath/aioredis/py.typed → /funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/add_to_pythonpath.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/aioredis/readme.md +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/dependency_packages_in_pythonpath/readme.md +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/develop_log.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/expire_lock.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/mongo_util.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/monkey_color_log.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/monkey_patches.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/mqtt_util.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/paramiko_util.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/pysnooper_ydf/__init__.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/pysnooper_ydf/pycompat.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/pysnooper_ydf/tracer.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/pysnooper_ydf/utils.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/pysnooper_ydf/variables.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/rabbitmq_factory.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/redis_manager_old.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/resource_monitoring.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/restart_python.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/time_util.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost/utils/un_strict_json_dumps.py +0 -0
- {funboost-30.2 → funboost-30.4}/funboost.egg-info/dependency_links.txt +0 -0
- {funboost-30.2 → funboost-30.4}/funboost.egg-info/entry_points.txt +0 -0
- {funboost-30.2 → funboost-30.4}/funboost.egg-info/requires.txt +0 -0
- {funboost-30.2 → funboost-30.4}/funboost.egg-info/top_level.txt +0 -0
- {funboost-30.2 → funboost-30.4}/setup.cfg +0 -0
- {funboost-30.2 → funboost-30.4}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: funboost
|
|
3
|
-
Version: 30.
|
|
3
|
+
Version: 30.4
|
|
4
4
|
Summary: pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和一切知名消息队列中间件,支持celery框架整体作为funboost中间件,python函数加速器,框架包罗万象,一统编程思维,兼容50% python业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数,99%用过funboost的pythoner 感受是 方便 快速 强大,相见恨晚
|
|
5
5
|
Home-page: https://github.com/ydf0509/funboost
|
|
6
6
|
Author: bfzs
|
|
@@ -418,7 +418,7 @@ if __name__ == "__main__":
|
|
|
418
418
|
|
|
419
419
|
[](https://imgse.com/i/pP2AsbQ)
|
|
420
420
|
|
|
421
|
-
|
|
421
|
+

|
|
422
422
|
|
|
423
423
|
|
|
424
424
|
|
|
@@ -43,6 +43,7 @@ from funboost.constant import BrokerEnum, ConcurrentModeEnum
|
|
|
43
43
|
from funboost.core.booster import boost, Booster
|
|
44
44
|
from funboost.core.get_booster import get_booster, get_or_create_booster, get_boost_params_and_consuming_function
|
|
45
45
|
from funboost.core.kill_remote_task import RemoteTaskKiller
|
|
46
|
+
from funboost.funboost_config_deafult import BrokerConnConfig,FunboostCommonConfig,BoostDecoratorDefaultParams
|
|
46
47
|
|
|
47
48
|
# from funboost.core.exit_signal import set_interrupt_signal_handler
|
|
48
49
|
from funboost.core.helper_funs import run_forever
|
|
@@ -55,4 +56,4 @@ from funboost.utils.redis_manager import RedisMixin
|
|
|
55
56
|
# 有的包默认没加handlers,原始的日志不漂亮且不可跳转不知道哪里发生的。这里把warnning级别以上的日志默认加上handlers。
|
|
56
57
|
# nb_log.get_logger(name='', log_level_int=30, log_filename='pywarning.log')
|
|
57
58
|
|
|
58
|
-
__version__ = "30.
|
|
59
|
+
__version__ = "30.4"
|
|
@@ -64,8 +64,8 @@ class CeleryHelper:
|
|
|
64
64
|
def _f():
|
|
65
65
|
python_executable = sys.executable
|
|
66
66
|
# print(python_executable)
|
|
67
|
-
# cmd = f'''{python_executable} -m celery -A
|
|
68
|
-
cmd = f'''{python_executable} -m celery
|
|
67
|
+
# cmd = f'''{python_executable} -m celery -A funboost.assist.celery_helper --broker={funboost_config_deafult.CELERY_BROKER_URL} --result-backend={funboost_config_deafult.CELERY_RESULT_BACKEND} flower --address=0.0.0.0 --port={port} --auto_refresh=True '''
|
|
68
|
+
cmd = f'''{python_executable} -m celery --broker={BrokerConnConfig.CELERY_BROKER_URL} --result-backend={BrokerConnConfig.CELERY_RESULT_BACKEND} flower --address=0.0.0.0 --port={port} --auto_refresh=True '''
|
|
69
69
|
|
|
70
70
|
logger.info(f'启动flower命令: {cmd}')
|
|
71
71
|
os.system(cmd)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# coding= utf-8
|
|
2
2
|
class BrokerEnum:
|
|
3
3
|
RABBITMQ_AMQPSTORM = 0 # 使用 amqpstorm 包操作rabbitmq 作为 分布式消息队列,支持消费确认.强烈推荐这个作为funboost中间件。
|
|
4
|
+
RABBITMQ = RABBITMQ_AMQPSTORM
|
|
4
5
|
|
|
5
6
|
RABBITMQ_RABBITPY = 1 # 使用 rabbitpy 包操作rabbitmq 作为 分布式消息队列,支持消费确认。
|
|
6
7
|
|
|
@@ -66,9 +67,10 @@ class BrokerEnum:
|
|
|
66
67
|
|
|
67
68
|
PEEWEE = 26 # peewee包操作mysql,使用表模拟消息队列
|
|
68
69
|
|
|
69
|
-
REDIS_PUBSUB = 27 # 基于redis
|
|
70
|
+
REDIS_PUBSUB = 27 # 基于redis 发布订阅的,发布一个消息多个消费者都能收到同一条消息,但不支持持久化
|
|
70
71
|
|
|
71
|
-
CELERY = 30 # funboost支持celery框架来发布和消费任务,由celery
|
|
72
|
+
CELERY = 30 # funboost支持celery框架来发布和消费任务,由celery框架来调度执行任务,但是写法简单远远暴击用户亲自使用celery的麻烦程度,
|
|
73
|
+
# 用户永无无需关心和操作Celery对象实例,无需关心celery的task_routes和include配置,funboost来自动化设置这些celery配置。
|
|
72
74
|
|
|
73
75
|
DRAMATIQ = 31 # funboost使用 dramatiq 框架作为消息队列,dramatiq类似celery也是任务队列框架。用户使用funboost api来操作dramatiq核心调度。
|
|
74
76
|
|
|
@@ -20,6 +20,7 @@ import os
|
|
|
20
20
|
import uuid
|
|
21
21
|
import time
|
|
22
22
|
import traceback
|
|
23
|
+
import inspect
|
|
23
24
|
# from collections import Callable
|
|
24
25
|
from typing import Callable
|
|
25
26
|
from functools import wraps
|
|
@@ -437,6 +438,7 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
437
438
|
self._check_broker_exclusive_config()
|
|
438
439
|
|
|
439
440
|
self._has_start_delay_task_scheduler = False
|
|
441
|
+
self._consuming_function_is_asyncio = inspect.iscoroutinefunction(self.consuming_function)
|
|
440
442
|
self.custom_init()
|
|
441
443
|
|
|
442
444
|
atexit.register(self.join_shedual_task_thread)
|
|
@@ -801,7 +803,9 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
801
803
|
t_start = time.time()
|
|
802
804
|
function_result_status.run_times = current_retry_times + 1
|
|
803
805
|
try:
|
|
804
|
-
function_run =
|
|
806
|
+
function_run = self.consuming_function
|
|
807
|
+
if self._consuming_function_is_asyncio:
|
|
808
|
+
function_run = sync_or_async_fun_deco(function_run)
|
|
805
809
|
function_timeout = self._get_priority_conf(kw, 'function_timeout')
|
|
806
810
|
function_run = function_run if self._consumin_function_decorator is None else self._consumin_function_decorator(function_run)
|
|
807
811
|
function_run = function_run if not function_timeout else self._concurrent_mode_dispatcher.timeout_deco(
|
|
@@ -814,14 +818,14 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
814
818
|
return function_result_status
|
|
815
819
|
function_run = kill_remote_task.kill_fun_deco(task_id)(function_run) # 用杀死装饰器包装起来在另一个线程运行函数,以便等待远程杀死。
|
|
816
820
|
function_result_status.result = function_run(**function_only_params)
|
|
817
|
-
if asyncio.iscoroutine(function_result_status.result):
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
821
|
+
# if asyncio.iscoroutine(function_result_status.result):
|
|
822
|
+
# log_msg = f'''异步的协程消费函数必须使用 async 并发模式并发,请设置消费函数 {self.consuming_function.__name__} 的concurrent_mode 为 ConcurrentModeEnum.ASYNC 或 4'''
|
|
823
|
+
# # self.logger.critical(msg=f'{log_msg} \n')
|
|
824
|
+
# # self.error_file_logger.critical(msg=f'{log_msg} \n')
|
|
825
|
+
# self._log_critical(msg=log_msg)
|
|
826
|
+
# # noinspection PyProtectedMember,PyUnresolvedReferences
|
|
827
|
+
#
|
|
828
|
+
# os._exit(4)
|
|
825
829
|
function_result_status.success = True
|
|
826
830
|
if self._log_level <= logging.DEBUG:
|
|
827
831
|
result_str_to_be_print = str(function_result_status.result)[:100] if len(str(function_result_status.result)) < 100 else str(function_result_status.result)[:100] + ' 。。。。。 '
|
|
@@ -32,7 +32,7 @@ class ConsumerConfirmMixinWithTheHelpOfRedis(RedisMixin):
|
|
|
32
32
|
self.keep_circulating(60, block=False)(self._requeue_tasks_which_unconfirmed)()
|
|
33
33
|
|
|
34
34
|
def _add_task_str_to_unack_zset(self, task_str, ):
|
|
35
|
-
self.redis_db_frame.zadd(self._unack_zset_name, task_str
|
|
35
|
+
self.redis_db_frame.zadd(self._unack_zset_name, {task_str: time.time()})
|
|
36
36
|
|
|
37
37
|
def _confirm_consume(self, kw):
|
|
38
38
|
self.redis_db_frame.zrem(self._unack_zset_name, kw['task_str'])
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# @Author : ydf
|
|
3
|
+
# @Time : 2022/8/8 0008 13:36
|
|
4
|
+
import json
|
|
5
|
+
from collections import deque
|
|
6
|
+
|
|
7
|
+
from funboost.constant import BrokerEnum
|
|
8
|
+
from funboost.consumers.base_consumer import AbstractConsumer
|
|
9
|
+
from funboost.publishers import meomory_deque_publisher
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class LocalPythonQueueConsumer(AbstractConsumer):
|
|
13
|
+
"""
|
|
14
|
+
python 内置queue对象作为消息队列,这个要求发布和消费必须在同一python解释器内部运行,不支持分布式。
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def local_python_queue(self) -> deque:
|
|
19
|
+
return meomory_deque_publisher.deque_queue_name__deque_obj_map[self._queue_name]
|
|
20
|
+
|
|
21
|
+
def _shedual_task(self):
|
|
22
|
+
while True:
|
|
23
|
+
task = self.local_python_queue.popleft()
|
|
24
|
+
if isinstance(task, str):
|
|
25
|
+
task = json.loads(task)
|
|
26
|
+
self._print_message_get_from_broker('当前python解释器内部', task)
|
|
27
|
+
# self.logger.debug(f'从当前python解释器内部的 [{self._queue_name}] 队列中 取出的消息是: {json.dumps(task)} ')
|
|
28
|
+
kw = {'body': task}
|
|
29
|
+
self._submit_task(kw)
|
|
30
|
+
|
|
31
|
+
def _confirm_consume(self, kw):
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
def _requeue(self, kw):
|
|
35
|
+
self.local_python_queue.append(kw['body'])
|
|
@@ -62,7 +62,7 @@ class RedisImpermanencyFilter(RedisFilter):
|
|
|
62
62
|
"""
|
|
63
63
|
|
|
64
64
|
def add_a_value(self, value: typing.Union[str, dict]):
|
|
65
|
-
self.redis_db_filter_and_rpc_result.zadd(self._redis_key_name, self._get_ordered_str(value)
|
|
65
|
+
self.redis_db_filter_and_rpc_result.zadd(self._redis_key_name, {self._get_ordered_str(value):time.time()})
|
|
66
66
|
|
|
67
67
|
def manual_delete_a_value(self, value: typing.Union[str, dict]):
|
|
68
68
|
self.redis_db_filter_and_rpc_result.zrem(self._redis_key_name, self._get_ordered_str(value))
|
|
@@ -86,6 +86,7 @@ class RedisImpermanencyFilter(RedisFilter):
|
|
|
86
86
|
@decorators.keep_circulating(60, block=False)
|
|
87
87
|
def delete_expire_filter_task_cycle(self):
|
|
88
88
|
"""
|
|
89
|
+
|
|
89
90
|
一直循环删除过期的过滤任务。任务过滤过期时间最好不要小于60秒,否则删除会不及时,导致发布的新任务不能触发执行。一般实时价格接口是缓存5分钟或30分钟。
|
|
90
91
|
:return:
|
|
91
92
|
"""
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import traceback
|
|
2
|
+
|
|
3
|
+
from funboost import AioAsyncResult, AsyncResult
|
|
4
|
+
|
|
5
|
+
from funboost.core.cli.discovery_boosters import BoosterDiscovery
|
|
6
|
+
from funboost.core.get_booster import get_booster
|
|
7
|
+
from fastapi import FastAPI
|
|
8
|
+
from pydantic import BaseModel
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class MsgItem(BaseModel):
|
|
12
|
+
queue_name: str # 队列名
|
|
13
|
+
msg_body: dict # 消息体,就是boost函数的入参字典,例如 {"x":1,"y":2}
|
|
14
|
+
need_result: bool = False # 发布消息后,是否需要返回结果
|
|
15
|
+
timeout: int = 60 # 等待结果返回的最大等待时间.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class PublishResponse(BaseModel):
|
|
19
|
+
succ: bool
|
|
20
|
+
msg: str
|
|
21
|
+
status_and_result: dict = None # 消费函数的消费状态和结果.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# 创建 FastAPI 应用实例
|
|
25
|
+
app = FastAPI()
|
|
26
|
+
|
|
27
|
+
'''
|
|
28
|
+
如果你在发布消息后还需要获取函数执行结果,
|
|
29
|
+
推荐使用asyncio类型的web框架例如 fastapi tornado,而不是使用flask django,更好的应付由于获取结果而需要的阻塞时间.不使用asyncio的话web框架需要设置开启很高的线程才行.
|
|
30
|
+
'''
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@app.post("/funboost_publish_msg")
|
|
34
|
+
async def publish_msg(msg_item: MsgItem):
|
|
35
|
+
status_and_result = None
|
|
36
|
+
try:
|
|
37
|
+
booster = get_booster(msg_item.queue_name)
|
|
38
|
+
if msg_item.need_result:
|
|
39
|
+
if booster.boost_params['is_using_rpc_mode'] is False:
|
|
40
|
+
raise ValueError(f' need_result 为true,{booster.queue_name} 队列消费者 需要@boost设置支持rpc模式')
|
|
41
|
+
async_result = booster.publish(msg_item.msg_body)
|
|
42
|
+
status_and_result = await AioAsyncResult(async_result.task_id, timeout=msg_item.timeout).status_and_result
|
|
43
|
+
# status_and_result = AsyncResult(async_result.task_id, timeout=msg_item.timeout).status_and_result
|
|
44
|
+
return PublishResponse(succ=True, msg=f'{msg_item.queue_name} 队列,消息发布成功', status_and_result=status_and_result)
|
|
45
|
+
except Exception as e:
|
|
46
|
+
return PublishResponse(succ=False, msg=f'{msg_item.queue_name} 队列,消息发布失败 {type(e)} {e} {traceback.format_exc()}',
|
|
47
|
+
status_and_result=status_and_result)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# 运行应用
|
|
51
|
+
if __name__ == "__main__":
|
|
52
|
+
import uvicorn
|
|
53
|
+
|
|
54
|
+
uvicorn.run('funboost.contrib.api_publish_msg:app', host="0.0.0.0", port=16666, workers=4)
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
1
2
|
import copy
|
|
2
3
|
import types
|
|
3
4
|
import typing
|
|
5
|
+
|
|
6
|
+
|
|
4
7
|
from functools import wraps
|
|
5
8
|
|
|
6
9
|
from funboost.core.function_result_status_config import FunctionResultStatusPersistanceConfig
|
|
@@ -18,7 +21,7 @@ class _Undefined:
|
|
|
18
21
|
|
|
19
22
|
class Booster:
|
|
20
23
|
"""
|
|
21
|
-
funboost极其重视代码能在pycharm下自动补全。元编程经常造成在pycharm
|
|
24
|
+
funboost极其重视代码能在pycharm下自动补全。元编程经常造成在pycharm下代码无法自动补全提示,主要是实现代码补全难。
|
|
22
25
|
这种__call__写法在pycahrm下 不仅能补全消费函数的 push consume等方法,也能补全函数本身的入参,一举两得。代码能自动补全很重要。
|
|
23
26
|
一个函数fun被 boost装饰器装饰后, isinstance(fun,Booster) 为True.
|
|
24
27
|
|
|
@@ -156,7 +159,7 @@ class Booster:
|
|
|
156
159
|
else:
|
|
157
160
|
return types.MethodType(self, instance)
|
|
158
161
|
|
|
159
|
-
def __call__(self, *args, **kwargs):
|
|
162
|
+
def __call__(self, *args, **kwargs) -> Booster:
|
|
160
163
|
if len(kwargs) == 0 and len(args) == 1 and isinstance(args[0], typing.Callable):
|
|
161
164
|
consuming_function = args[0]
|
|
162
165
|
self.consuming_function = consuming_function
|
|
@@ -43,6 +43,7 @@ class BoosterFire(object):
|
|
|
43
43
|
def show_all_queues(self):
|
|
44
44
|
"""显示扫描到的所有queue name"""
|
|
45
45
|
print(f'get_all_queues: {get_all_queues()}')
|
|
46
|
+
return self
|
|
46
47
|
|
|
47
48
|
def clear(self, *queue_names: str):
|
|
48
49
|
"""
|
|
@@ -51,6 +52,7 @@ class BoosterFire(object):
|
|
|
51
52
|
|
|
52
53
|
for queue_anme in queue_names:
|
|
53
54
|
get_booster(queue_anme).clear()
|
|
55
|
+
return self
|
|
54
56
|
|
|
55
57
|
def push(self, queue_anme, *args, **kwargs):
|
|
56
58
|
"""push发布消息到消息队列 ;
|
|
@@ -60,6 +62,11 @@ class BoosterFire(object):
|
|
|
60
62
|
或者 push add_queue -x 1 -y 2;
|
|
61
63
|
"""
|
|
62
64
|
get_booster(queue_anme).push(*args, **kwargs)
|
|
65
|
+
return self
|
|
66
|
+
|
|
67
|
+
def __str__(self):
|
|
68
|
+
# print('over') # 这行重要,否则命令行链式调用无法自动结束
|
|
69
|
+
return ''
|
|
63
70
|
|
|
64
71
|
def publish(self, queue_anme, msg):
|
|
65
72
|
"""publish发布消息到消息队列;
|
|
@@ -68,6 +75,7 @@ class BoosterFire(object):
|
|
|
68
75
|
"""
|
|
69
76
|
|
|
70
77
|
get_booster(queue_anme).publish(msg)
|
|
78
|
+
return self
|
|
71
79
|
|
|
72
80
|
def consume(self, *queue_names: str):
|
|
73
81
|
"""
|
|
@@ -97,3 +105,10 @@ class BoosterFire(object):
|
|
|
97
105
|
for queue_anme in queue_names:
|
|
98
106
|
get_booster(queue_anme).pause()
|
|
99
107
|
|
|
108
|
+
def continue_consume(self, *queue_names: str):
|
|
109
|
+
"""
|
|
110
|
+
继续多个消息队列名的消费;
|
|
111
|
+
例子: continue_consume queue1 queue2
|
|
112
|
+
"""
|
|
113
|
+
for queue_anme in queue_names:
|
|
114
|
+
get_booster(queue_anme).continue_consume()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
+
import time
|
|
2
3
|
|
|
3
4
|
import typing
|
|
4
5
|
import json
|
|
@@ -141,6 +142,7 @@ if __name__ == '__main__':
|
|
|
141
142
|
@property
|
|
142
143
|
async def status_and_result(self):
|
|
143
144
|
if not self._has_pop:
|
|
145
|
+
t1 = time.time()
|
|
144
146
|
redis_value = await self.aioredis_db_filter_and_rpc_result.blpop(self.task_id, self.timeout)
|
|
145
147
|
self._has_pop = True
|
|
146
148
|
if redis_value is not None:
|
{funboost-30.2 → funboost-30.4}/funboost/factories/broker_kind__publsiher_consumer_type_map.py
RENAMED
|
@@ -103,7 +103,8 @@ def register_custom_broker(broker_kind, publisher_class: typing.Type[AbstractPub
|
|
|
103
103
|
def regist_to_funboost(broker_kind: int):
|
|
104
104
|
"""
|
|
105
105
|
延迟导入是因为funboost没有pip自动安装这些三方包,防止一启动就报错。
|
|
106
|
-
这样当用户需要使用某些三方包中间件作为消息队列时候,按照import报错信息,用户自己去pip
|
|
106
|
+
这样当用户需要使用某些三方包中间件作为消息队列时候,按照import报错信息,用户自己去pip安装好。或者 pip install funboost[all] 一次性安装所有中间件。
|
|
107
|
+
建议按照 https://github.com/ydf0509/funboost/blob/master/setup.py 中的 extra_brokers 和 install_requires 里面的版本号来安装三方包版本.
|
|
107
108
|
"""
|
|
108
109
|
|
|
109
110
|
if broker_kind == BrokerEnum.PULSAR:
|
|
@@ -159,4 +160,5 @@ def regist_to_funboost(broker_kind: int):
|
|
|
159
160
|
|
|
160
161
|
if __name__ == '__main__':
|
|
161
162
|
import sys
|
|
162
|
-
|
|
163
|
+
|
|
164
|
+
print(sys.modules)
|
|
@@ -7,7 +7,7 @@ from funboost.core.function_result_status_config import FunctionResultStatusPers
|
|
|
7
7
|
from funboost.utils.simple_data_class import DataClassBase
|
|
8
8
|
|
|
9
9
|
'''
|
|
10
|
-
|
|
10
|
+
funboost_config.py 文件是第一次运行框架自动生成到你的项目根目录的,不需要用由户手动创建。
|
|
11
11
|
此文件里面可以写任意python代码。例如 中间件 帐号 密码自己完全可以从apola配置中心获取或者从环境变量获取。
|
|
12
12
|
'''
|
|
13
13
|
|
|
@@ -60,7 +60,7 @@ class BrokerConnConfig(DataClassBase):
|
|
|
60
60
|
MYSQL_PASSWORD = '123456'
|
|
61
61
|
MYSQL_DATABASE = 'testdb6'
|
|
62
62
|
|
|
63
|
-
# persist_quque中间件时候采用本机sqlite
|
|
63
|
+
# persist_quque中间件时候采用本机sqlite的方式,数据库文件生成的位置,如果linux账号在根目录没权限建文件夹,可以换文件夹。
|
|
64
64
|
SQLLITE_QUEUES_PATH = '/sqllite_queues'
|
|
65
65
|
|
|
66
66
|
TXT_FILE_PATH = Path(__file__).parent / 'txt_queues' # 不建议使用这个txt模拟消息队列中间件,本地持久化优先选择 PERSIST_QUQUE 中间件。
|
|
@@ -88,9 +88,6 @@ class BrokerConnConfig(DataClassBase):
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
class FunboostCommonConfig(DataClassBase):
|
|
91
|
-
"""
|
|
92
|
-
funboost运行的其它全局默认配置
|
|
93
|
-
"""
|
|
94
91
|
# nb_log包的第几个日志模板,内置了7个模板,可以在你当前项目根目录下的nb_log_config.py文件扩展模板。
|
|
95
92
|
NB_LOG_FORMATER_INDEX_FOR_CONSUMER_AND_PUBLISHER = 11 # 7是简短的不可跳转,5是可点击跳转的,11是可显示ip 进程 线程的模板。
|
|
96
93
|
TIMEZONE = 'Asia/Shanghai'
|
|
@@ -113,6 +110,8 @@ class BoostDecoratorDefaultParams(DataClassBase):
|
|
|
113
110
|
所以boost装饰器只有一个是必传参数。
|
|
114
111
|
"""
|
|
115
112
|
|
|
113
|
+
broker_kind: int = BrokerEnum.PERSISTQUEUE # 中间件选型见3.1章节 https://funboost.readthedocs.io/zh/latest/articles/c3.html
|
|
114
|
+
|
|
116
115
|
concurrent_mode = ConcurrentModeEnum.THREADING
|
|
117
116
|
concurrent_num = 50
|
|
118
117
|
specify_concurrent_pool = None
|
|
@@ -151,4 +150,4 @@ class BoostDecoratorDefaultParams(DataClassBase):
|
|
|
151
150
|
|
|
152
151
|
broker_exclusive_config = {}
|
|
153
152
|
|
|
154
|
-
|
|
153
|
+
|
|
@@ -145,6 +145,7 @@ if __name__ == '__main__':
|
|
|
145
145
|
app.run(debug=False, threaded=True, host='0.0.0.0', port=27018)
|
|
146
146
|
|
|
147
147
|
'''
|
|
148
|
+
linux 是export , win是 set
|
|
148
149
|
# 第一步 export PYTHONPATH=你的项目根目录 ,这么做是为了这个web可以读取到你项目根目录下的 funboost_config.py里面的配置
|
|
149
150
|
# 例如 export PYTHONPATH=/home/ydf/codes/ydfhome
|
|
150
151
|
或者 export PYTHONPATH=./ (./是相对路径,前提是已近cd到你的项目根目录了,也可以写绝对路径全路径)
|
|
@@ -47,6 +47,7 @@ class CeleryPublisher(AbstractPublisher, ):
|
|
|
47
47
|
with celery_app.connection_or_acquire() as conn:
|
|
48
48
|
msg_cnt = conn.default_channel.queue_declare(
|
|
49
49
|
queue=self.queue_name, passive=False,durable=True,auto_delete=False).message_count
|
|
50
|
+
|
|
50
51
|
return msg_cnt
|
|
51
52
|
|
|
52
53
|
def close(self):
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# @Author : ydf
|
|
3
|
+
# @Time : 2022/8/8 0008 13:07
|
|
4
|
+
from collections import deque
|
|
5
|
+
from queue import Queue, SimpleQueue
|
|
6
|
+
|
|
7
|
+
from funboost.publishers.base_publisher import AbstractPublisher
|
|
8
|
+
|
|
9
|
+
local_pyhton_queue_name__local_pyhton_queue_obj_map = dict() # 使local queue和其他中间件完全一样的使用方式,使用映射保存队列的名字,使消费和发布通过队列名字能找到队列对象。
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class LocalPythonQueuePublisher(AbstractPublisher):
|
|
13
|
+
"""
|
|
14
|
+
使用python内置queue对象作为中间件。方便测试,每个中间件的消费者类是鸭子类,多态可以互相替换。
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
# noinspection PyAttributeOutsideInit
|
|
18
|
+
def custom_init(self):
|
|
19
|
+
if self._queue_name not in local_pyhton_queue_name__local_pyhton_queue_obj_map:
|
|
20
|
+
local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name] = Queue(1000000)
|
|
21
|
+
self.queue = local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name]
|
|
22
|
+
|
|
23
|
+
def concrete_realization_of_publish(self, msg):
|
|
24
|
+
# noinspection PyTypeChecker
|
|
25
|
+
self.queue.put(msg)
|
|
26
|
+
|
|
27
|
+
def clear(self):
|
|
28
|
+
# noinspection PyUnresolvedReferences
|
|
29
|
+
self.queue.queue.clear()
|
|
30
|
+
self.logger.warning(f'清除 本地队列中的消息成功')
|
|
31
|
+
|
|
32
|
+
def get_message_count(self):
|
|
33
|
+
return self.queue.qsize()
|
|
34
|
+
|
|
35
|
+
def close(self):
|
|
36
|
+
pass
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class LocalPythonQueuePublisherSimpleQueue(AbstractPublisher):
|
|
40
|
+
"""
|
|
41
|
+
使用python内置SimpleQueue对象作为中间件。方便测试,每个中间件的消费者类是鸭子类,多态可以互相替换。
|
|
42
|
+
"""
|
|
43
|
+
|
|
44
|
+
# noinspection PyAttributeOutsideInit
|
|
45
|
+
def custom_init(self):
|
|
46
|
+
if self._queue_name not in local_pyhton_queue_name__local_pyhton_queue_obj_map:
|
|
47
|
+
local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name] = SimpleQueue()
|
|
48
|
+
self.queue = local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name] # type: SimpleQueue
|
|
49
|
+
|
|
50
|
+
def concrete_realization_of_publish(self, msg):
|
|
51
|
+
# noinspection PyTypeChecker
|
|
52
|
+
self.queue.put(msg)
|
|
53
|
+
|
|
54
|
+
def clear(self):
|
|
55
|
+
pass
|
|
56
|
+
# noinspection PyUnresolvedReferences
|
|
57
|
+
# self.queue._queue.clear()
|
|
58
|
+
# self.logger.warning(f'清除 本地队列中的消息成功')
|
|
59
|
+
|
|
60
|
+
def get_message_count(self):
|
|
61
|
+
return self.queue.qsize()
|
|
62
|
+
|
|
63
|
+
def close(self):
|
|
64
|
+
pass
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
class LocalPythonQueuePublisherDeque(AbstractPublisher):
|
|
68
|
+
"""
|
|
69
|
+
使用python内置 Dequeu 对象作为中间件。方便测试,每个中间件的消费者类是鸭子类,多态可以互相替换。
|
|
70
|
+
"""
|
|
71
|
+
|
|
72
|
+
# noinspection PyAttributeOutsideInit
|
|
73
|
+
def custom_init(self):
|
|
74
|
+
if self._queue_name not in local_pyhton_queue_name__local_pyhton_queue_obj_map:
|
|
75
|
+
local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name] = deque()
|
|
76
|
+
self.queue = local_pyhton_queue_name__local_pyhton_queue_obj_map[self._queue_name] # type: deque
|
|
77
|
+
# deque.get = deque.pop
|
|
78
|
+
# # setattr(self.queue,'get',self.queue.pop)
|
|
79
|
+
|
|
80
|
+
def concrete_realization_of_publish(self, msg):
|
|
81
|
+
# noinspection PyTypeChecker
|
|
82
|
+
print(msg)
|
|
83
|
+
self.queue.append(msg)
|
|
84
|
+
|
|
85
|
+
def clear(self):
|
|
86
|
+
pass
|
|
87
|
+
# noinspection PyUnresolvedReferences
|
|
88
|
+
self.queue.clear()
|
|
89
|
+
self.logger.warning(f'清除 本地队列中的消息成功')
|
|
90
|
+
|
|
91
|
+
def get_message_count(self):
|
|
92
|
+
return len(self.queue)
|
|
93
|
+
|
|
94
|
+
def close(self):
|
|
95
|
+
pass
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# @Author : ydf
|
|
3
|
+
# @Time : 2022/8/8 0008 13:07
|
|
4
|
+
from collections import deque
|
|
5
|
+
|
|
6
|
+
from funboost.publishers.base_publisher import AbstractPublisher
|
|
7
|
+
|
|
8
|
+
deque_queue_name__deque_obj_map = dict() # 使local queue和其他中间件完全一样的使用方式,使用映射保存队列的名字,使消费和发布通过队列名字能找到队列对象。
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DequePublisher(AbstractPublisher):
|
|
12
|
+
"""
|
|
13
|
+
使用python内置queue对象作为中间件。方便测试,每个中间件的消费者类是鸭子类,多态可以互相替换。
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
# noinspection PyAttributeOutsideInit
|
|
17
|
+
def custom_init(self):
|
|
18
|
+
if self._queue_name not in deque_queue_name__deque_obj_map:
|
|
19
|
+
deque_queue_name__deque_obj_map[self._queue_name] = deque()
|
|
20
|
+
self.queue = deque_queue_name__deque_obj_map[self._queue_name] # type: deque
|
|
21
|
+
|
|
22
|
+
def concrete_realization_of_publish(self, msg):
|
|
23
|
+
# noinspection PyTypeChecker
|
|
24
|
+
self.queue.append(msg)
|
|
25
|
+
|
|
26
|
+
def clear(self):
|
|
27
|
+
pass
|
|
28
|
+
# noinspection PyUnresolvedReferences
|
|
29
|
+
self.queue.clear()
|
|
30
|
+
self.logger.warning(f'清除 本地队列中的消息成功')
|
|
31
|
+
|
|
32
|
+
def get_message_count(self):
|
|
33
|
+
return len(self.queue)
|
|
34
|
+
|
|
35
|
+
def close(self):
|
|
36
|
+
pass
|
|
@@ -19,7 +19,7 @@ from apscheduler.util import undefined
|
|
|
19
19
|
import deprecated
|
|
20
20
|
from funboost.utils.redis_manager import RedisMixin
|
|
21
21
|
|
|
22
|
-
from funboost.funboost_config_deafult import BrokerConnConfig,FunboostCommonConfig
|
|
22
|
+
from funboost.funboost_config_deafult import BrokerConnConfig, FunboostCommonConfig
|
|
23
23
|
|
|
24
24
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
25
25
|
from funboost.core.get_booster import get_booster, Booster
|
|
@@ -39,12 +39,12 @@ def timing_publish_deco(consuming_func_decorated_or_consumer: Union[callable, Ab
|
|
|
39
39
|
return _deco
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def push_fun_params_to_broker(queue_name: str, *args, **kwargs
|
|
42
|
+
def push_fun_params_to_broker(queue_name: str, *args, runonce_uuid=None, **kwargs):
|
|
43
43
|
"""
|
|
44
|
+
queue_name 队列名字
|
|
44
45
|
*args **kwargs 是消费函数的入参
|
|
46
|
+
发布消息中可以包括,runonce_uuid这个入参,确保分布式多个脚本都启动了定时器,导致每个定时器重复发布到消息队列,值你自己写 str(uuid.uuid4())
|
|
45
47
|
"""
|
|
46
|
-
runonce_uuid = kwargs['runonce_uuid']
|
|
47
|
-
kwargs.pop('runonce_uuid')
|
|
48
48
|
if runonce_uuid:
|
|
49
49
|
key = 'apscheduler.redisjobstore_runonce2'
|
|
50
50
|
if RedisMixin().redis_db_frame.sadd(key, runonce_uuid):
|
|
@@ -69,10 +69,11 @@ class FunboostBackgroundScheduler(BackgroundScheduler):
|
|
|
69
69
|
next_run_time, jobstore, executor,
|
|
70
70
|
replace_existing, **trigger_args)
|
|
71
71
|
|
|
72
|
-
def add_push_job(self, func: Booster, trigger=None, args=None, kwargs=None,
|
|
72
|
+
def add_push_job(self, func: Booster, trigger=None, args=None, kwargs=None, runonce_uuid=None,
|
|
73
|
+
id=None, name=None,
|
|
73
74
|
misfire_grace_time=undefined, coalesce=undefined, max_instances=undefined,
|
|
74
75
|
next_run_time=undefined, jobstore='default', executor='default',
|
|
75
|
-
replace_existing=False,
|
|
76
|
+
replace_existing=False, **trigger_args, ):
|
|
76
77
|
"""
|
|
77
78
|
:param func: 被@boost装饰器装饰的函数
|
|
78
79
|
:param trigger:
|
|
@@ -162,7 +163,7 @@ fsdf_background_scheduler = funboost_aps_scheduler # 兼容一下老名字。
|
|
|
162
163
|
if __name__ == '__main__':
|
|
163
164
|
# 定时运行消费演示
|
|
164
165
|
import datetime
|
|
165
|
-
from funboost import boost, BrokerEnum, fsdf_background_scheduler, timing_publish_deco, run_forever
|
|
166
|
+
from funboost import boost, BrokerEnum, fsdf_background_scheduler, timing_publish_deco, run_forever
|
|
166
167
|
|
|
167
168
|
|
|
168
169
|
@Booster('queue_test_666', broker_kind=BrokerEnum.LOCAL_PYTHON_QUEUE)
|
|
@@ -171,6 +172,7 @@ if __name__ == '__main__':
|
|
|
171
172
|
|
|
172
173
|
|
|
173
174
|
print(consume_func, type(consume_func))
|
|
175
|
+
|
|
174
176
|
# 定时每隔3秒执行一次。
|
|
175
177
|
funboost_aps_scheduler.add_push_job(consume_func,
|
|
176
178
|
'interval', id='3_second_job', seconds=3, kwargs={"x": 5, "y": 6})
|
funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-37.pyc
ADDED
|
Binary file
|
funboost-30.4/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-39.pyc
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|