funboost 44.1__tar.gz → 44.2__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-44.1/funboost.egg-info → funboost-44.2}/PKG-INFO +2 -1
- {funboost-44.1 → funboost-44.2}/funboost/__init__.py +1 -1
- {funboost-44.1 → funboost-44.2}/funboost/consumers/base_consumer.py +10 -7
- {funboost-44.1 → funboost-44.2}/funboost/consumers/http_consumer.py +9 -9
- {funboost-44.1 → funboost-44.2}/funboost/consumers/kafka_consumer.py +12 -14
- {funboost-44.1 → funboost-44.2}/funboost/consumers/kafka_consumer_manually_commit.py +10 -13
- {funboost-44.1 → funboost-44.2}/funboost/consumers/mqtt_consumer.py +3 -2
- {funboost-44.1 → funboost-44.2}/funboost/consumers/nats_consumer.py +5 -4
- {funboost-44.1 → funboost-44.2}/funboost/consumers/nsq_consumer.py +6 -4
- {funboost-44.1 → funboost-44.2}/funboost/consumers/zeromq_consumer.py +12 -11
- funboost-44.2/funboost/core/funboost_config_getter.py +7 -0
- funboost-44.2/funboost/core/funboost_time.py +28 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/helper_funs.py +21 -9
- {funboost-44.1 → funboost-44.2}/funboost/core/lazy_impoter.py +86 -4
- {funboost-44.1 → funboost-44.2}/funboost/core/loggers.py +1 -1
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/app.py +3 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/functions.py +0 -1
- {funboost-44.1 → funboost-44.2}/funboost/publishers/base_publisher.py +4 -7
- {funboost-44.1 → funboost-44.2}/funboost/publishers/confluent_kafka_publisher.py +9 -12
- {funboost-44.1 → funboost-44.2}/funboost/publishers/kafka_publisher.py +5 -11
- {funboost-44.1 → funboost-44.2}/funboost/publishers/mqtt_publisher.py +3 -2
- {funboost-44.1 → funboost-44.2}/funboost/publishers/nats_publisher.py +2 -2
- {funboost-44.1 → funboost-44.2}/funboost/publishers/nsq_publisher.py +4 -6
- {funboost-44.1 → funboost-44.2}/funboost/publishers/zeromq_publisher.py +3 -3
- {funboost-44.1 → funboost-44.2}/funboost/set_frame_config.py +1 -1
- {funboost-44.1 → funboost-44.2}/funboost/utils/bulk_operation.py +3 -2
- {funboost-44.1 → funboost-44.2}/funboost/utils/decorators.py +0 -2
- {funboost-44.1 → funboost-44.2}/funboost/utils/resource_monitoring.py +10 -9
- {funboost-44.1 → funboost-44.2/funboost.egg-info}/PKG-INFO +2 -1
- {funboost-44.1 → funboost-44.2}/funboost.egg-info/SOURCES.txt +2 -1
- {funboost-44.1 → funboost-44.2}/funboost.egg-info/requires.txt +34 -16
- {funboost-44.1 → funboost-44.2}/setup.py +16 -26
- funboost-44.1/funboost/core/try_get_user_funboost_common_config.py +0 -0
- {funboost-44.1 → funboost-44.2}/LICENSE +0 -0
- {funboost-44.1 → funboost-44.2}/MANIFEST.in +0 -0
- {funboost-44.1 → funboost-44.2}/README.md +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/__init__old.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/__main__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/assist/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/assist/celery_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/assist/dramatiq_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/assist/huey_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/assist/rocketry_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/assist/rq_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/assist/rq_windows_worker.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/beggar_version_implementation/beggar_redis_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/async_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/async_pool_executor.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/backup/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/backup/async_pool_executor0223.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/backup/async_pool_executor_back.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/backup/async_pool_executor_janus.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/base_pool_type.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/bounded_processpoolexcutor_gt_py37.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/bounded_processpoolexcutor_py36.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/bounded_threadpoolexcutor.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/concurrent_pool_with_multi_process.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/custom_evenlet_pool_executor.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/custom_gevent_pool_executor.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/custom_threadpool_executor.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/custom_threadpool_executor000.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/fixed_thread_pool.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/flexible_thread_pool.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/pool_commons.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/concurrent_pool/single_thread_executor.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/constant.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/celery_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/confirm_mixin.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/dramatiq_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/http_consumer000.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/httpsqs_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/huey_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/kombu_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/local_python_queue_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/memory_deque_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/mongomq_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/nameko_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/peewee_conusmer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/persist_queue_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/pulsar_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/rabbitmq_amqpstorm_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/rabbitmq_pika_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/rabbitmq_pika_consumerv0.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/rabbitmq_rabbitpy_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_brpoplpush_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_consumer_ack_able.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_consumer_priority.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_consumer_simple.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_filter.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_pubsub_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/redis_stream_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/rocketmq_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/rq_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/sqlachemy_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/tcp_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/txt_file_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/consumers/udp_consumer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/contrib/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/contrib/api_publish_msg.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/contrib/django_db_deco.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/contrib/queue2queue.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/contrib/redis_consume_latest_msg_broker.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/contrib/save_result_status_to_sqldb.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/active_cousumer_info_getter.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/booster.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/cli/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/cli/discovery_boosters.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/cli/funboost_cli_user_templ.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/cli/funboost_fire.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/current_task.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/exceptions.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/fabric_deploy_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/func_params_model.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/function_result_status_config.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/function_result_status_saver.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/kill_remote_task.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/msg_result_getter.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/muliti_process_enhance.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/core/task_id_logger.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/factories/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/factories/broker_kind__publsiher_consumer_type_map.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/factories/consumer_factory.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/factories/publisher_factotry.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/funboost_config_deafult.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/__pycache__/app.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/assets/css/custom.css +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/assets/css/jquery.mCustomScrollbar.min.css +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/assets/img/user.jpg +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/assets/js/custom.js +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/assets/js/jquery.mCustomScrollbar.concat.min.js +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/css/style.css +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/images/bg.jpg +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/images/password.png +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/images/tick.png +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/images/user.png +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/static/js/jquery-1.11.0.min.js +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/templates/index.html +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/function_result_web/templates/login.html +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/celery_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/celery_publisher000.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/dramatiq_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/http_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/httpsqs_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/huey_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/kombu_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/local_python_queue_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/meomory_deque_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/mongomq_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/nameko_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/peewee_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/persist_queue_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/pulsar_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/rabbitmq_amqpstorm_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/rabbitmq_pika_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/rabbitmq_rabbitpy_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/redis_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/redis_publisher_lpush.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/redis_publisher_priority.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/redis_publisher_simple.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/redis_pubsub_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/redis_queue_flush_mixin.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/redis_stream_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/rocketmq_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/rq_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/sqla_queue_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/tcp_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/txt_file_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/publishers/udp_publisher.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/queues/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/queues/peewee_queue.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/queues/sqla_queue.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/timing_job/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/timing_job/apscheduler_use_mysql_store.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/timing_job/apscheduler_use_redis_store.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/apscheduler_monkey.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/block_exit.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/ctrl_c_end.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/custom_pysnooper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages/mongomq/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages/mongomq/lock.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages/mongomq/mongomq.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages/mongomq/mongomq0000.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages/mongomq/test.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages/mongomq/utils.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/add_to_pythonpath.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/client.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/compat.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/connection.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/exceptions.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/lock.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/log.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/py.typed +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/readme.md +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/sentinel.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/aioredis/utils.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/StoppableThread.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-311.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-37.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-39.pyc +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/dafunc.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/exceptions.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/py2_raise.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/func_timeout/py3_raise.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/dependency_packages_in_pythonpath/readme.md +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/develop_log.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/expire_lock.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/json_helper.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/mongo_util.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/monkey_color_log.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/monkey_patches.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/mqtt_util.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/paramiko_util.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/pysnooper_ydf/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/pysnooper_ydf/pycompat.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/pysnooper_ydf/tracer.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/pysnooper_ydf/utils.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/pysnooper_ydf/variables.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/rabbitmq_factory.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/redis_manager.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/redis_manager_old.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/restart_python.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/simple_data_class.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/time_util.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/times/__init__.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/times/version.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost/utils/un_strict_json_dumps.py +0 -0
- {funboost-44.1 → funboost-44.2}/funboost.egg-info/dependency_links.txt +0 -0
- {funboost-44.1 → funboost-44.2}/funboost.egg-info/entry_points.txt +0 -0
- {funboost-44.1 → funboost-44.2}/funboost.egg-info/top_level.txt +0 -0
- {funboost-44.1 → funboost-44.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: funboost
|
|
3
|
-
Version: 44.
|
|
3
|
+
Version: 44.2
|
|
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
|
|
@@ -27,6 +27,7 @@ Classifier: Topic :: Software Development :: Libraries
|
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
Provides-Extra: all
|
|
29
29
|
Provides-Extra: extra_brokers
|
|
30
|
+
Provides-Extra: flask
|
|
30
31
|
License-File: LICENSE
|
|
31
32
|
|
|
32
33
|
|
|
@@ -49,7 +49,7 @@ from funboost.concurrent_pool.single_thread_executor import SoloExecutor
|
|
|
49
49
|
|
|
50
50
|
from funboost.core.function_result_status_saver import ResultPersistenceHelper, FunctionResultStatus, RunStatus
|
|
51
51
|
|
|
52
|
-
from funboost.core.helper_funs import delete_keys_and_return_new_dict, get_publish_time,
|
|
52
|
+
from funboost.core.helper_funs import delete_keys_and_return_new_dict, get_publish_time, MsgGenerater
|
|
53
53
|
|
|
54
54
|
from funboost.concurrent_pool.async_helper import simple_run_in_executor
|
|
55
55
|
from funboost.concurrent_pool.async_pool_executor import AsyncPoolExecutor
|
|
@@ -383,8 +383,11 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
383
383
|
"""
|
|
384
384
|
raise NotImplementedError
|
|
385
385
|
|
|
386
|
-
def
|
|
387
|
-
"""
|
|
386
|
+
def convert_msg_before_run(self, msg: dict):
|
|
387
|
+
"""
|
|
388
|
+
转换消息,消息没有使用funboost来发送,并且没有extra相关字段时候
|
|
389
|
+
用户也可以按照4.21文档,继承任意Consumer类,并实现这个方法 convert_msg_before_run,先转换消息.
|
|
390
|
+
"""
|
|
388
391
|
""" 一般消息至少包含这样
|
|
389
392
|
{
|
|
390
393
|
"a": 42,
|
|
@@ -405,11 +408,11 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
405
408
|
msg['extra'] = {'is_auto_fill_extra': True}
|
|
406
409
|
extra = msg['extra']
|
|
407
410
|
if 'task_id' not in extra:
|
|
408
|
-
extra['task_id'] = generate_task_id(self._queue_name)
|
|
411
|
+
extra['task_id'] = MsgGenerater.generate_task_id(self._queue_name)
|
|
409
412
|
if 'publish_time' not in extra:
|
|
410
|
-
extra['publish_time'] =
|
|
413
|
+
extra['publish_time'] = MsgGenerater.generate_publish_time()
|
|
411
414
|
if 'publish_time_format':
|
|
412
|
-
extra['publish_time_format'] =
|
|
415
|
+
extra['publish_time_format'] = MsgGenerater.generate_publish_time_format()
|
|
413
416
|
|
|
414
417
|
def _submit_task(self, kw):
|
|
415
418
|
while 1: # 这一块的代码为支持暂停消费。
|
|
@@ -426,7 +429,7 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
426
429
|
self._requeue(kw)
|
|
427
430
|
time.sleep(self.time_interval_for_check_do_not_run_time)
|
|
428
431
|
return
|
|
429
|
-
self.
|
|
432
|
+
self.convert_msg_before_run(kw['body'])
|
|
430
433
|
function_only_params = delete_keys_and_return_new_dict(kw['body'], )
|
|
431
434
|
if self._get_priority_conf(kw, 'do_task_filtering') and self._redis_filter.check_value_exists(
|
|
432
435
|
function_only_params): # 对函数的参数进行检查,过滤已经执行过并且成功的任务。
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import asyncio
|
|
5
5
|
import json
|
|
6
6
|
|
|
7
|
-
from aiohttp import web
|
|
8
|
-
from aiohttp.web_request import Request
|
|
7
|
+
# from aiohttp import web
|
|
8
|
+
# from aiohttp.web_request import Request
|
|
9
9
|
|
|
10
10
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
11
|
-
|
|
11
|
+
from funboost.core.lazy_impoter import AioHttpImporter
|
|
12
12
|
|
|
13
13
|
class HTTPConsumer(AbstractConsumer, ):
|
|
14
14
|
"""
|
|
@@ -38,26 +38,26 @@ class HTTPConsumer(AbstractConsumer, ):
|
|
|
38
38
|
#
|
|
39
39
|
# flask_app.run('0.0.0.0', port=self._port,debug=False)
|
|
40
40
|
|
|
41
|
-
routes = web.RouteTableDef()
|
|
41
|
+
routes = AioHttpImporter().web.RouteTableDef()
|
|
42
42
|
|
|
43
43
|
# noinspection PyUnusedLocal
|
|
44
44
|
@routes.get('/')
|
|
45
45
|
async def hello(request):
|
|
46
|
-
return web.Response(text="Hello, from funboost")
|
|
46
|
+
return AioHttpImporter().web.Response(text="Hello, from funboost")
|
|
47
47
|
|
|
48
48
|
@routes.post('/queue')
|
|
49
|
-
async def recv_msg(request: Request):
|
|
49
|
+
async def recv_msg(request: AioHttpImporter().Request):
|
|
50
50
|
data = await request.post()
|
|
51
51
|
msg = data['msg']
|
|
52
52
|
kw = {'body': json.loads(msg)}
|
|
53
53
|
self._submit_task(kw)
|
|
54
|
-
return web.Response(text="finish")
|
|
54
|
+
return AioHttpImporter().web.Response(text="finish")
|
|
55
55
|
|
|
56
|
-
app = web.Application()
|
|
56
|
+
app = AioHttpImporter().web.Application()
|
|
57
57
|
app.add_routes(routes)
|
|
58
58
|
loop = asyncio.new_event_loop()
|
|
59
59
|
asyncio.set_event_loop(loop)
|
|
60
|
-
web.run_app(app, host='0.0.0.0', port=self._port, )
|
|
60
|
+
AioHttpImporter().web.run_app(app, host='0.0.0.0', port=self._port, )
|
|
61
61
|
|
|
62
62
|
def _confirm_consume(self, kw):
|
|
63
63
|
pass # 没有确认消费的功能。
|
|
@@ -3,16 +3,14 @@
|
|
|
3
3
|
# @Time : 2022/8/8 0008 13:32
|
|
4
4
|
import json
|
|
5
5
|
# noinspection PyPackageRequirements
|
|
6
|
-
|
|
7
|
-
# noinspection PyPackageRequirements
|
|
8
|
-
from kafka.admin import NewTopic
|
|
9
|
-
# noinspection PyPackageRequirements
|
|
10
|
-
from kafka.errors import TopicAlreadyExistsError
|
|
6
|
+
|
|
11
7
|
from funboost.constant import BrokerEnum
|
|
12
8
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
9
|
+
from funboost.core.lazy_impoter import KafkaPythonImporter
|
|
13
10
|
from funboost.funboost_config_deafult import BrokerConnConfig
|
|
14
11
|
# from nb_log import get_logger
|
|
15
12
|
from funboost.core.loggers import get_funboost_file_logger
|
|
13
|
+
|
|
16
14
|
# LogManager('kafka').get_logger_and_add_handlers(30)
|
|
17
15
|
get_funboost_file_logger('kafka', log_level_int=30)
|
|
18
16
|
|
|
@@ -36,18 +34,18 @@ class KafkaConsumer(AbstractConsumer):
|
|
|
36
34
|
|
|
37
35
|
def _shedual_task(self):
|
|
38
36
|
try:
|
|
39
|
-
admin_client = KafkaAdminClient(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
40
|
-
admin_client.create_topics([NewTopic(self._queue_name, 10, 1)])
|
|
37
|
+
admin_client = KafkaPythonImporter().KafkaAdminClient(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
38
|
+
admin_client.create_topics([KafkaPythonImporter().NewTopic(self._queue_name, 10, 1)])
|
|
41
39
|
# admin_client.create_partitions({self._queue_name: NewPartitions(total_count=16)})
|
|
42
|
-
except TopicAlreadyExistsError:
|
|
40
|
+
except KafkaPythonImporter().TopicAlreadyExistsError:
|
|
43
41
|
pass
|
|
44
42
|
|
|
45
|
-
self._producer = KafkaProducer(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
46
|
-
consumer = OfficialKafkaConsumer(self._queue_name, bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
self._producer = KafkaPythonImporter().KafkaProducer(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
44
|
+
consumer = KafkaPythonImporter().OfficialKafkaConsumer(self._queue_name, bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS,
|
|
45
|
+
group_id=self.consumer_params.broker_exclusive_config["group_id"],
|
|
46
|
+
enable_auto_commit=True,
|
|
47
|
+
auto_offset_reset=self.consumer_params.broker_exclusive_config["auto_offset_reset"],
|
|
48
|
+
)
|
|
51
49
|
# auto_offset_reset (str): A policy for resetting offsets on
|
|
52
50
|
# OffsetOutOfRange errors: 'earliest' will move to the oldest
|
|
53
51
|
# available message, 'latest' will move to the most recent. Any
|
|
@@ -10,13 +10,10 @@ from collections import defaultdict, OrderedDict
|
|
|
10
10
|
import time
|
|
11
11
|
|
|
12
12
|
# noinspection PyPackageRequirements
|
|
13
|
-
|
|
13
|
+
# pip install kafka-python==2.0.2
|
|
14
14
|
|
|
15
|
-
# noinspection PyPackageRequirements
|
|
16
|
-
from kafka.admin import NewTopic
|
|
17
|
-
# noinspection PyPackageRequirements
|
|
18
|
-
from kafka.errors import TopicAlreadyExistsError
|
|
19
15
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
16
|
+
from funboost.core.lazy_impoter import KafkaPythonImporter
|
|
20
17
|
from funboost.funboost_config_deafult import BrokerConnConfig
|
|
21
18
|
from confluent_kafka.cimpl import TopicPartition
|
|
22
19
|
from confluent_kafka import Consumer as ConfluentConsumer # 这个包在win下不好安装,用户用这个中间件的时候自己再想办法安装。win用户需要安装c++ 14.0以上环境。
|
|
@@ -39,13 +36,13 @@ class KafkaConsumerManuallyCommit(AbstractConsumer):
|
|
|
39
36
|
def _shedual_task(self):
|
|
40
37
|
|
|
41
38
|
try:
|
|
42
|
-
admin_client = KafkaAdminClient(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
43
|
-
admin_client.create_topics([NewTopic(self._queue_name, 10, 1)])
|
|
39
|
+
admin_client = KafkaPythonImporter().KafkaAdminClient(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
40
|
+
admin_client.create_topics([KafkaPythonImporter().NewTopic(self._queue_name, 10, 1)])
|
|
44
41
|
# admin_client.create_partitions({self._queue_name: NewPartitions(total_count=16)})
|
|
45
|
-
except TopicAlreadyExistsError:
|
|
42
|
+
except KafkaPythonImporter().TopicAlreadyExistsError:
|
|
46
43
|
pass
|
|
47
44
|
|
|
48
|
-
self._producer = KafkaProducer(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
45
|
+
self._producer = KafkaPythonImporter().KafkaProducer(bootstrap_servers=BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS)
|
|
49
46
|
# consumer 配置 https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
|
|
50
47
|
self._confluent_consumer = ConfluentConsumer({
|
|
51
48
|
'bootstrap.servers': ','.join(BrokerConnConfig.KAFKA_BOOTSTRAP_SERVERS),
|
|
@@ -130,14 +127,14 @@ class SaslPlainKafkaConsumer(KafkaConsumerManuallyCommit):
|
|
|
130
127
|
def _shedual_task(self):
|
|
131
128
|
|
|
132
129
|
try:
|
|
133
|
-
admin_client = KafkaAdminClient(
|
|
130
|
+
admin_client = KafkaPythonImporter().KafkaAdminClient(
|
|
134
131
|
**BrokerConnConfig.KFFKA_SASL_CONFIG)
|
|
135
|
-
admin_client.create_topics([NewTopic(self._queue_name, 10, 1)])
|
|
132
|
+
admin_client.create_topics([KafkaPythonImporter().NewTopic(self._queue_name, 10, 1)])
|
|
136
133
|
# admin_client.create_partitions({self._queue_name: NewPartitions(total_count=16)})
|
|
137
|
-
except TopicAlreadyExistsError:
|
|
134
|
+
except KafkaPythonImporter().TopicAlreadyExistsError:
|
|
138
135
|
pass
|
|
139
136
|
|
|
140
|
-
self._producer = KafkaProducer(
|
|
137
|
+
self._producer = KafkaPythonImporter().KafkaProducer(
|
|
141
138
|
**BrokerConnConfig.KFFKA_SASL_CONFIG)
|
|
142
139
|
# consumer 配置 https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
|
|
143
140
|
self._confluent_consumer = ConfluentConsumer({
|
|
@@ -5,8 +5,9 @@ import json
|
|
|
5
5
|
# import time
|
|
6
6
|
from funboost.constant import BrokerEnum
|
|
7
7
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
8
|
+
from funboost.core.lazy_impoter import PahoMqttImporter
|
|
8
9
|
from funboost.funboost_config_deafult import BrokerConnConfig
|
|
9
|
-
import paho.mqtt.client as mqtt
|
|
10
|
+
# import paho.mqtt.client as mqtt
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
class MqttConsumer(AbstractConsumer):
|
|
@@ -23,7 +24,7 @@ class MqttConsumer(AbstractConsumer):
|
|
|
23
24
|
|
|
24
25
|
# noinspection DuplicatedCode
|
|
25
26
|
def _shedual_task(self):
|
|
26
|
-
client = mqtt.Client()
|
|
27
|
+
client = PahoMqttImporter().mqtt.Client()
|
|
27
28
|
# client.username_pw_set('admin', password='public')
|
|
28
29
|
client.on_connect = self._on_connect
|
|
29
30
|
client.on_message = self._on_message
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from pynats import NATSClient, NATSMessage # noqa
|
|
3
|
-
|
|
2
|
+
# from pynats import NATSClient, NATSMessage # noqa
|
|
3
|
+
|
|
4
4
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
5
|
+
from funboost.core.lazy_impoter import NatsImporter
|
|
5
6
|
from funboost.funboost_config_deafult import BrokerConnConfig
|
|
6
7
|
|
|
7
8
|
|
|
@@ -13,10 +14,10 @@ class NatsConsumer(AbstractConsumer):
|
|
|
13
14
|
|
|
14
15
|
def _shedual_task(self):
|
|
15
16
|
# print(88888888888888)
|
|
16
|
-
nats_client = NATSClient(BrokerConnConfig.NATS_URL, socket_timeout=600, socket_keepalive=True)
|
|
17
|
+
nats_client = NatsImporter().NATSClient(BrokerConnConfig.NATS_URL, socket_timeout=600, socket_keepalive=True)
|
|
17
18
|
nats_client.connect()
|
|
18
19
|
|
|
19
|
-
def callback(msg: NATSMessage):
|
|
20
|
+
def callback(msg: NatsImporter().NATSMessage):
|
|
20
21
|
# print(type(msg))
|
|
21
22
|
# print(msg.reply)
|
|
22
23
|
# print(f"Received a message with subject {msg.subject}: {msg.payload}")
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
# @Author : ydf
|
|
3
3
|
# @Time : 2022/8/8 0008 13:32
|
|
4
4
|
import json
|
|
5
|
-
|
|
6
|
-
from funboost.
|
|
5
|
+
|
|
6
|
+
from funboost.core.lazy_impoter import GnsqImporter
|
|
7
|
+
# from gnsq import Consumer, Message
|
|
8
|
+
|
|
7
9
|
from funboost.funboost_config_deafult import BrokerConnConfig
|
|
8
10
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
9
11
|
# from nb_log import LogManager
|
|
@@ -19,11 +21,11 @@ class NsqConsumer(AbstractConsumer):
|
|
|
19
21
|
|
|
20
22
|
|
|
21
23
|
def _shedual_task(self):
|
|
22
|
-
consumer = Consumer(self._queue_name, 'frame_channel', BrokerConnConfig.NSQD_TCP_ADDRESSES,
|
|
24
|
+
consumer = GnsqImporter().Consumer(self._queue_name, 'frame_channel', BrokerConnConfig.NSQD_TCP_ADDRESSES,
|
|
23
25
|
max_in_flight=self.consumer_params.concurrent_num, heartbeat_interval=60, timeout=600, ) # heartbeat_interval 不能设置为600
|
|
24
26
|
|
|
25
27
|
@consumer.on_message.connect
|
|
26
|
-
def handler(consumerx: Consumer, message: Message):
|
|
28
|
+
def handler(consumerx: GnsqImporter().Consumer, message: GnsqImporter().Message):
|
|
27
29
|
# 第一条消息不能并发,第一条消息之后可以并发。
|
|
28
30
|
self._print_message_get_from_broker('nsq', message.body.decode())
|
|
29
31
|
# self.logger.debug(f'从nsq的 [{self._queue_name}] 主题中 取出的消息是: {message.body.decode()}')
|
|
@@ -4,10 +4,11 @@ import os
|
|
|
4
4
|
import socket
|
|
5
5
|
import json
|
|
6
6
|
# import time
|
|
7
|
-
import zmq
|
|
7
|
+
# import zmq
|
|
8
8
|
import multiprocessing
|
|
9
9
|
from funboost.constant import BrokerEnum
|
|
10
10
|
from funboost.consumers.base_consumer import AbstractConsumer
|
|
11
|
+
from funboost.core.lazy_impoter import ZmqImporter
|
|
11
12
|
# from nb_log import get_logger
|
|
12
13
|
from funboost.core.loggers import get_funboost_file_logger
|
|
13
14
|
|
|
@@ -32,17 +33,17 @@ logger_zeromq_broker = get_funboost_file_logger('zeromq_broker')
|
|
|
32
33
|
# noinspection PyUnresolvedReferences
|
|
33
34
|
def start_broker(port_router: int, port_dealer: int):
|
|
34
35
|
try:
|
|
35
|
-
context = zmq.Context()
|
|
36
|
+
context = ZmqImporter().zmq.Context()
|
|
36
37
|
# noinspection PyUnresolvedReferences
|
|
37
|
-
frontend = context.socket(zmq.ROUTER)
|
|
38
|
-
backend = context.socket(zmq.DEALER)
|
|
38
|
+
frontend = context.socket(ZmqImporter().zmq.ROUTER)
|
|
39
|
+
backend = context.socket(ZmqImporter().zmq.DEALER)
|
|
39
40
|
frontend.bind(f"tcp://*:{port_router}")
|
|
40
41
|
backend.bind(f"tcp://*:{port_dealer}")
|
|
41
42
|
|
|
42
43
|
# Initialize poll set
|
|
43
|
-
poller = zmq.Poller()
|
|
44
|
-
poller.register(frontend, zmq.POLLIN)
|
|
45
|
-
poller.register(backend, zmq.POLLIN)
|
|
44
|
+
poller = ZmqImporter().zmq.Poller()
|
|
45
|
+
poller.register(frontend, ZmqImporter().zmq.POLLIN)
|
|
46
|
+
poller.register(backend, ZmqImporter().zmq.POLLIN)
|
|
46
47
|
logger_zeromq_broker.info(f'broker 绑定端口 {port_router} {port_dealer} 成功')
|
|
47
48
|
|
|
48
49
|
# Switch messages between sockets
|
|
@@ -50,11 +51,11 @@ def start_broker(port_router: int, port_dealer: int):
|
|
|
50
51
|
while True:
|
|
51
52
|
socks = dict(poller.poll()) # 轮询器 循环接收
|
|
52
53
|
|
|
53
|
-
if socks.get(frontend) == zmq.POLLIN:
|
|
54
|
+
if socks.get(frontend) == ZmqImporter().zmq.POLLIN:
|
|
54
55
|
message = frontend.recv_multipart()
|
|
55
56
|
backend.send_multipart(message)
|
|
56
57
|
|
|
57
|
-
if socks.get(backend) == zmq.POLLIN:
|
|
58
|
+
if socks.get(backend) == ZmqImporter().zmq.POLLIN:
|
|
58
59
|
message = backend.recv_multipart()
|
|
59
60
|
frontend.send_multipart(message)
|
|
60
61
|
except BaseException as e:
|
|
@@ -87,9 +88,9 @@ class ZeroMqConsumer(AbstractConsumer):
|
|
|
87
88
|
# noinspection DuplicatedCode
|
|
88
89
|
def _shedual_task(self):
|
|
89
90
|
self.start_broker_queue_name_as_port()
|
|
90
|
-
context = zmq.Context()
|
|
91
|
+
context = ZmqImporter().zmq.Context()
|
|
91
92
|
# noinspection PyUnresolvedReferences
|
|
92
|
-
zsocket = context.socket(zmq.REP)
|
|
93
|
+
zsocket = context.socket(ZmqImporter().zmq.REP)
|
|
93
94
|
zsocket.connect(f"tcp://localhost:{int(self._queue_name) + 1}")
|
|
94
95
|
|
|
95
96
|
while True:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
def _try_get_user_funboost_common_config(funboost_common_conf_field:str):
|
|
2
|
+
try:
|
|
3
|
+
import funboost_config # 第一次启动funboost前还没这个文件,或者还没有初始化配置之前,就要使用使用配置.
|
|
4
|
+
return getattr(funboost_config.FunboostCommonConfig,funboost_common_conf_field)
|
|
5
|
+
except Exception as e:
|
|
6
|
+
print(e)
|
|
7
|
+
return None
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import pytz
|
|
2
|
+
import time
|
|
3
|
+
|
|
4
|
+
import datetime
|
|
5
|
+
|
|
6
|
+
import typing
|
|
7
|
+
|
|
8
|
+
from nb_time import NbTime
|
|
9
|
+
from funboost.funboost_config_deafult import FunboostCommonConfig
|
|
10
|
+
|
|
11
|
+
class FunboostTime(NbTime):
|
|
12
|
+
default_formatter = NbTime.FORMATTER_DATETIME_NO_ZONE
|
|
13
|
+
def get_time_zone_str(self,time_zone: typing.Union[str, datetime.tzinfo,None] = None):
|
|
14
|
+
return time_zone or self.default_time_zone or FunboostCommonConfig.TIMEZONE or self.get_localzone_name()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if __name__ == '__main__':
|
|
19
|
+
print(NbTime())
|
|
20
|
+
for i in range(100000):
|
|
21
|
+
# print(generate_publish_time())
|
|
22
|
+
# print(generate_publish_time_format())
|
|
23
|
+
# generate_publish_time()
|
|
24
|
+
# generate_publish_time_format()
|
|
25
|
+
|
|
26
|
+
datetime.datetime.now(tz=pytz.timezone(FunboostCommonConfig.TIMEZONE)).strftime(NbTime.FORMATTER_DATETIME_NO_ZONE)
|
|
27
|
+
datetime.datetime.now(tz=pytz.timezone(FunboostCommonConfig.TIMEZONE)).timestamp()
|
|
28
|
+
print(NbTime())
|
|
@@ -2,6 +2,8 @@ import copy
|
|
|
2
2
|
import time
|
|
3
3
|
import uuid
|
|
4
4
|
|
|
5
|
+
from funboost.core.funboost_time import FunboostTime
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
def get_publish_time(paramsx: dict):
|
|
7
9
|
"""
|
|
@@ -37,13 +39,23 @@ def block_python_main_thread_exit():
|
|
|
37
39
|
run_forever = block_python_main_thread_exit
|
|
38
40
|
|
|
39
41
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
class MsgGenerater:
|
|
43
|
+
@staticmethod
|
|
44
|
+
def generate_task_id(queue_name:str) -> str:
|
|
45
|
+
return f'{queue_name}_result:{uuid.uuid4()}'
|
|
46
|
+
|
|
47
|
+
@staticmethod
|
|
48
|
+
def generate_publish_time() -> float:
|
|
49
|
+
return round(FunboostTime().timestamp,4)
|
|
50
|
+
|
|
51
|
+
@staticmethod
|
|
52
|
+
def generate_publish_time_format() -> str:
|
|
53
|
+
return FunboostTime().get_str()
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def generate_pulish_time_and_task_id(cls,queue_name:str,task_id=None):
|
|
57
|
+
extra_params = {'task_id': task_id or cls.generate_task_id(queue_name), 'publish_time': cls.generate_publish_time(),
|
|
58
|
+
'publish_time_format': cls.generate_publish_time_format()}
|
|
59
|
+
return extra_params
|
|
60
|
+
|
|
47
61
|
|
|
48
|
-
def generate_task_id(queue_name:str):
|
|
49
|
-
return f'{queue_name}_result:{uuid.uuid4()}'
|
|
@@ -2,8 +2,11 @@ import abc
|
|
|
2
2
|
|
|
3
3
|
from funboost.utils.decorators import cached_method_result, singleton, SingletonBaseNew, SingletonBaseCustomInit
|
|
4
4
|
|
|
5
|
+
"""
|
|
6
|
+
延迟导入
|
|
7
|
+
或者使用时候再pip安装
|
|
8
|
+
"""
|
|
5
9
|
|
|
6
|
-
# @singleton # 不方便代码补全
|
|
7
10
|
|
|
8
11
|
class LazyImpoter(SingletonBaseNew):
|
|
9
12
|
"""
|
|
@@ -79,20 +82,99 @@ class EventletImporter:
|
|
|
79
82
|
self.patcher = patcher
|
|
80
83
|
self.Timeout = Timeout
|
|
81
84
|
|
|
85
|
+
|
|
82
86
|
@singleton
|
|
83
87
|
class PeeweeImporter:
|
|
84
88
|
def __init__(self):
|
|
85
|
-
|
|
89
|
+
"""pip install peewee == 3.17"""
|
|
86
90
|
from peewee import ModelSelect, Model, BigAutoField, CharField, DateTimeField, MySQLDatabase
|
|
87
91
|
from playhouse.shortcuts import model_to_dict, dict_to_model
|
|
88
92
|
self.ModelSelect = ModelSelect
|
|
89
93
|
self.Model = Model
|
|
90
94
|
self.BigAutoField = BigAutoField
|
|
91
95
|
self.CharField = CharField
|
|
92
|
-
self.DateTimeField =DateTimeField
|
|
96
|
+
self.DateTimeField = DateTimeField
|
|
93
97
|
self.MySQLDatabase = MySQLDatabase
|
|
94
98
|
self.model_to_dict = model_to_dict
|
|
95
|
-
self.dict_to_model =dict_to_model
|
|
99
|
+
self.dict_to_model = dict_to_model
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
@singleton
|
|
103
|
+
class AioHttpImporter:
|
|
104
|
+
|
|
105
|
+
def __init__(self):
|
|
106
|
+
"""pip install aiohttp==3.8.3"""
|
|
107
|
+
from aiohttp import web
|
|
108
|
+
from aiohttp.web_request import Request
|
|
109
|
+
self.web = web
|
|
110
|
+
self.Request = Request
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@singleton
|
|
114
|
+
class NatsImporter:
|
|
115
|
+
def __init__(self):
|
|
116
|
+
"""pip install nats-python """
|
|
117
|
+
from pynats import NATSClient, NATSMessage
|
|
118
|
+
self.NATSClient = NATSClient
|
|
119
|
+
self.NATSMessage = NATSMessage
|
|
120
|
+
|
|
121
|
+
@singleton
|
|
122
|
+
class GnsqImporter:
|
|
123
|
+
def __init__(self):
|
|
124
|
+
"""pip install gnsq==1.0.1"""
|
|
125
|
+
from gnsq import Consumer, Message
|
|
126
|
+
from gnsq import Producer, NsqdHTTPClient
|
|
127
|
+
from gnsq.errors import NSQHttpError
|
|
128
|
+
self.Consumer = Consumer
|
|
129
|
+
self.Message = Message
|
|
130
|
+
self.Producer = Producer
|
|
131
|
+
self.NsqdHTTPClient = NsqdHTTPClient
|
|
132
|
+
self.NSQHttpError = NSQHttpError
|
|
133
|
+
|
|
134
|
+
@singleton
|
|
135
|
+
class ElasticsearchImporter:
|
|
136
|
+
def __init__(self):
|
|
137
|
+
"""pip install elasticsearch """
|
|
138
|
+
from elasticsearch import helpers
|
|
139
|
+
self.helpers = helpers
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
@singleton
|
|
143
|
+
class PsutilImporter:
|
|
144
|
+
def __init__(self):
|
|
145
|
+
"""pip install psutil"""
|
|
146
|
+
import psutil
|
|
147
|
+
self.psutil = psutil
|
|
148
|
+
|
|
149
|
+
@singleton
|
|
150
|
+
class PahoMqttImporter:
|
|
151
|
+
def __init__(self):
|
|
152
|
+
"""pip install paho-mqtt"""
|
|
153
|
+
import paho.mqtt.client as mqtt
|
|
154
|
+
self.mqtt = mqtt
|
|
155
|
+
|
|
156
|
+
@singleton
|
|
157
|
+
class ZmqImporter:
|
|
158
|
+
def __init__(self):
|
|
159
|
+
"""pip install zmq pyzmq"""
|
|
160
|
+
import zmq
|
|
161
|
+
self.zmq = zmq
|
|
162
|
+
|
|
163
|
+
@singleton
|
|
164
|
+
class KafkaPythonImporter:
|
|
165
|
+
def __init__(self):
|
|
166
|
+
"""pip install kafka-python==2.0.2"""
|
|
167
|
+
|
|
168
|
+
from kafka import KafkaConsumer as OfficialKafkaConsumer, KafkaProducer, KafkaAdminClient
|
|
169
|
+
from kafka.admin import NewTopic
|
|
170
|
+
from kafka.errors import TopicAlreadyExistsError
|
|
171
|
+
|
|
172
|
+
self.OfficialKafkaConsumer = OfficialKafkaConsumer
|
|
173
|
+
self.KafkaProducer = KafkaProducer
|
|
174
|
+
self.KafkaAdminClient = KafkaAdminClient
|
|
175
|
+
self.NewTopic = NewTopic
|
|
176
|
+
self.TopicAlreadyExistsError = TopicAlreadyExistsError
|
|
177
|
+
|
|
96
178
|
|
|
97
179
|
if __name__ == '__main__':
|
|
98
180
|
for i in range(10000):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import nb_log
|
|
2
|
-
from funboost.core.
|
|
2
|
+
from funboost.core.funboost_config_getter import _try_get_user_funboost_common_config
|
|
3
3
|
|
|
4
4
|
# noinspection PyUnresolvedReferences
|
|
5
5
|
from nb_log import get_logger, LoggerLevelSetterMixin, nb_log_config_default
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import datetime
|
|
6
6
|
import json
|
|
7
7
|
|
|
8
|
+
"""
|
|
9
|
+
pip install Flask flask_bootstrap flask_wtf wtforms flask_login
|
|
10
|
+
"""
|
|
8
11
|
from flask import render_template, Flask, request, url_for, jsonify, flash, redirect
|
|
9
12
|
from flask_bootstrap import Bootstrap
|
|
10
13
|
from flask_wtf import FlaskForm
|
|
@@ -9,17 +9,15 @@ import json
|
|
|
9
9
|
import logging
|
|
10
10
|
import multiprocessing
|
|
11
11
|
import threading
|
|
12
|
-
import uuid
|
|
13
12
|
import time
|
|
14
13
|
import typing
|
|
15
14
|
from functools import wraps
|
|
16
15
|
from threading import Lock
|
|
17
|
-
import datetime
|
|
18
16
|
import amqpstorm
|
|
19
17
|
|
|
20
18
|
import nb_log
|
|
21
19
|
from funboost.core.func_params_model import PublisherParams, PriorityConsumingControlConfig
|
|
22
|
-
from funboost.core.helper_funs import
|
|
20
|
+
from funboost.core.helper_funs import MsgGenerater
|
|
23
21
|
from funboost.core.loggers import develop_logger
|
|
24
22
|
|
|
25
23
|
from pikav1.exceptions import AMQPError as PikaAMQPError
|
|
@@ -28,7 +26,7 @@ from pikav1.exceptions import AMQPError as PikaAMQPError
|
|
|
28
26
|
from funboost.core.loggers import LoggerLevelSetterMixin, FunboostFileLoggerMixin, get_logger
|
|
29
27
|
from funboost.core.msg_result_getter import AsyncResult, AioAsyncResult
|
|
30
28
|
from funboost.core.task_id_logger import TaskIdLogger
|
|
31
|
-
from funboost.utils import decorators
|
|
29
|
+
from funboost.utils import decorators
|
|
32
30
|
from funboost.funboost_config_deafult import BrokerConnConfig, FunboostCommonConfig
|
|
33
31
|
|
|
34
32
|
RedisAsyncResult = AsyncResult # 别名
|
|
@@ -191,9 +189,8 @@ class AbstractPublisher(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
191
189
|
raw_extra = msg['extra']
|
|
192
190
|
if self.publish_params_checker and self.publisher_params.should_check_publish_func_params:
|
|
193
191
|
self.publish_params_checker.check_params(msg_function_kw)
|
|
194
|
-
task_id = task_id or generate_task_id(self._queue_name)
|
|
195
|
-
extra_params =
|
|
196
|
-
'publish_time_format': time.strftime('%Y-%m-%d %H:%M:%S')}
|
|
192
|
+
task_id = task_id or MsgGenerater.generate_task_id(self._queue_name)
|
|
193
|
+
extra_params = MsgGenerater.generate_pulish_time_and_task_id(self._queue_name, task_id=task_id)
|
|
197
194
|
if priority_control_config:
|
|
198
195
|
extra_params.update(priority_control_config.dict(exclude_none=True))
|
|
199
196
|
extra_params.update(raw_extra)
|