DefStream 0.1.17__tar.gz → 0.1.18__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.
- {defstream-0.1.17 → defstream-0.1.18}/.github/ISSUE_TEMPLATE/01.feature.yml +0 -2
- {defstream-0.1.17 → defstream-0.1.18}/.github/ISSUE_TEMPLATE/02.bug.yml +0 -2
- {defstream-0.1.17 → defstream-0.1.18}/.github/ISSUE_TEMPLATE/03.fix.yml +0 -2
- {defstream-0.1.17 → defstream-0.1.18}/.github/ISSUE_TEMPLATE/04.task.yml +0 -2
- {defstream-0.1.17 → defstream-0.1.18}/.github/workflows/ci.yml +24 -61
- defstream-0.1.18/DefStream.egg-info/PKG-INFO +92 -0
- {defstream-0.1.17 → defstream-0.1.18}/DefStream.egg-info/SOURCES.txt +52 -3
- defstream-0.1.18/PKG-INFO +92 -0
- defstream-0.1.18/README.en.md +73 -0
- defstream-0.1.18/README.md +73 -0
- defstream-0.1.18/README.setup.md +59 -0
- defstream-0.1.18/docs/Contracts.en.md +175 -0
- defstream-0.1.18/docs/Contracts.md +168 -0
- defstream-0.1.18/docs/GettingStarted.en.md +191 -0
- defstream-0.1.18/docs/GettingStarted.md +186 -0
- defstream-0.1.18/docs/LifecycleHooks.en.md +214 -0
- defstream-0.1.18/docs/LifecycleHooks.md +210 -0
- defstream-0.1.18/docs/Operations.en.md +176 -0
- defstream-0.1.18/docs/Operations.md +167 -0
- defstream-0.1.18/docs/README.en.md +38 -0
- defstream-0.1.18/docs/README.md +38 -0
- defstream-0.1.18/docs/RabbitMQ.en.md +294 -0
- defstream-0.1.18/docs/RabbitMQ.md +283 -0
- defstream-0.1.18/docs/Redis.en.md +229 -0
- defstream-0.1.18/docs/Redis.md +225 -0
- defstream-0.1.18/docs/Tasks.en.md +174 -0
- defstream-0.1.18/docs/Tasks.md +171 -0
- defstream-0.1.18/instructions/CODE.instructions.md +32 -0
- defstream-0.1.18/instructions/DOCS.instructions.md +55 -0
- defstream-0.1.18/instructions/README.instructions.md +36 -0
- defstream-0.1.18/issues/fix/29/ISSUE.md +13 -0
- defstream-0.1.18/issues/fix/29/README.md +5 -0
- defstream-0.1.18/issues/fix/29/REQUIREMENTS.md +48 -0
- defstream-0.1.18/issues/fix/29/TASK.md +26 -0
- defstream-0.1.18/issues/fix/41/CHANGELOG.md +21 -0
- defstream-0.1.18/issues/fix/41/IMPLEMENTS.md +31 -0
- defstream-0.1.18/issues/fix/41/PLAN.md +22 -0
- defstream-0.1.18/issues/fix/41/README.md +113 -0
- defstream-0.1.18/issues/fix/41/REQUIREMENTS.md +33 -0
- defstream-0.1.18/issues/fix/41/TASKS.md +24 -0
- defstream-0.1.18/issues/fix/41/implements/1793257519898.md +27 -0
- defstream-0.1.18/issues/fix/41/implements/1793257826069.md +33 -0
- defstream-0.1.18/issues/fix/41/tasks/1793256929057.md +9 -0
- defstream-0.1.18/issues/fix/41/tasks/1793256990072.md +26 -0
- defstream-0.1.18/issues/fix/41/tasks/1793257216492.md +30 -0
- defstream-0.1.18/issues/fix/41/tasks/1793257519899.md +33 -0
- defstream-0.1.18/issues/fix/41/tasks/1793257826068.md +42 -0
- defstream-0.1.18/issues/task/32/IMPLEMENTS.md +107 -0
- defstream-0.1.18/issues/task/32/ISSUE.md +105 -0
- defstream-0.1.18/issues/task/32/PLAN.md +164 -0
- defstream-0.1.18/issues/task/32/README.md +19 -0
- defstream-0.1.18/issues/task/32/REQUIREMENTS.md +168 -0
- defstream-0.1.18/issues/task/32/TASK.md +36 -0
- defstream-0.1.18/issues/task/34/CHANGELOG.md +3 -0
- defstream-0.1.18/issues/task/34/IMPLEMENTS.md +26 -0
- defstream-0.1.18/issues/task/34/PLAN.md +38 -0
- defstream-0.1.18/issues/task/34/README.md +51 -0
- defstream-0.1.18/issues/task/34/REQUIREMENTS.md +73 -0
- defstream-0.1.18/issues/task/36/CHANGELOG.md +5 -0
- defstream-0.1.18/issues/task/36/IMPLEMENTS.md +35 -0
- defstream-0.1.18/issues/task/36/PLAN.md +58 -0
- defstream-0.1.18/issues/task/36/README.md +49 -0
- defstream-0.1.18/issues/task/36/REQUIREMENTS.md +78 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Broker/RabbitMQ/Sample.RPC.py +1 -1
- {defstream-0.1.17 → defstream-0.1.18}/samples/Broker/RabbitMQ/Sample.Stream.py +1 -1
- {defstream-0.1.17 → defstream-0.1.18}/samples/Broker/RabbitMQ/Sample.py +1 -1
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Configuration.py +6 -5
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Connection.py +54 -49
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Consumer.py +10 -11
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Event.py +1 -1
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Exchange.py +9 -9
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Queue.py +15 -13
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Serializer.py +17 -3
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Stream.py +10 -8
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_protocol_contracts.py +4 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_rabbitmq_broker_methods.py +2 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_rabbitmq_logging.py +24 -10
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_rabbitmq_priorities.py +2 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_rabbitmq_rpc.py +1 -1
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_rabbitmq_rpc_integration.py +1 -1
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_task_messages.py +6 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_task_priorities.py +2 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_worker_startup.py +4 -0
- defstream-0.1.17/DefStream.egg-info/PKG-INFO +0 -1174
- defstream-0.1.17/PKG-INFO +0 -1174
- defstream-0.1.17/README.en.md +0 -1159
- defstream-0.1.17/README.md +0 -1121
- defstream-0.1.17/README.setup.md +0 -1141
- defstream-0.1.17/tests/test_rabbitmq_release_workflow.py +0 -398
- defstream-0.1.17/tests/test_redis_release_workflow.py +0 -398
- defstream-0.1.17/tests/test_release_workflow.py +0 -469
- {defstream-0.1.17 → defstream-0.1.18}/.github/ISSUE_TEMPLATE/config.yml +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/.gitignore +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/DefStream.egg-info/dependency_links.txt +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/DefStream.egg-info/requires.txt +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/DefStream.egg-info/top_level.txt +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/LICENSE +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/bug/16/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/bug/16/ISSUE.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/bug/16/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/bug/16/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/1/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/1/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/1/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/1/TASK.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/1/ci.refs.json +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/8/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/8/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/8/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/feature/8/ci.refs.json +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/10/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/10/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/10/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/13/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/21/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/21/ISSUE.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/21/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/21/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/24/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/24/ISSUE.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/24/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/24/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/25/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/25/ISSUE.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/25/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/25/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/25/TASK.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/26/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/26/ISSUE.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/26/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/26/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/3/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/3/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/3/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/3/ci.refs.json +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/6/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/6/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/fix/6/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/task/18/IMPLEMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/task/18/README.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/issues/task/18/REQUIREMENTS.md +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Broker/Redis/Sample.Stream.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Broker/Redis/Sample.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Broker/Sample.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Worker/RabbitMQ/Client.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Worker/RabbitMQ/Tasks.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Worker/RabbitMQ/Worker.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Worker/Redis/Sample.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/samples/Worker/Sample.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/setup.cfg +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/setup.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Configuration.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Connection.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Consumer.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Errors.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Event.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Policies.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/Subscription.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/RabbitMQ/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/Configuration.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/Connection.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/Consumer.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/Event.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/Queue.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/Serializer.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/Subscription.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/Redis/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Implements/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Policies.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Priority.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/Protocol.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Broker/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Descriptor/DataObject.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Descriptor/Types.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Descriptor/Value.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Descriptor/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extension.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/Console.html +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/Console.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/Metrics.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/Ping.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/Specifications.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/Status.html +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/Status.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Extensions/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Inspector.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/Response.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Inspector/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Pattern.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Array.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Common.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Compare.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Condition.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/DataObject.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/DateTime.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Number.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Object.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Size.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/String.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/Type.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Patterns/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Validate.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/Validator.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Validator/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/Executor.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/Message.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/Pool.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/Run.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/Specification.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/Startup.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/Worker.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/Worker/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/src/__init__.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_broker_packaging.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_descriptor.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_inspector.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_inspector_console.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_inspector_logging.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_lifecycle_hooks.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_logging.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_pool_callbacks.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_process_signals.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_rabbitmq_integration.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_rabbitmq_worker.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_redis.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_redis_integration.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_redis_logging.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_runner_hooks.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_specifications.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_status.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_status_ui.cjs +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_validator_patterns.py +0 -0
- {defstream-0.1.17 → defstream-0.1.18}/tests/test_worker.py +0 -0
|
@@ -2,7 +2,6 @@ name: CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
pull_request:
|
|
5
|
-
branches: [master]
|
|
6
5
|
push:
|
|
7
6
|
branches: [master]
|
|
8
7
|
|
|
@@ -18,7 +17,7 @@ concurrency:
|
|
|
18
17
|
|
|
19
18
|
jobs:
|
|
20
19
|
changes:
|
|
21
|
-
name:
|
|
20
|
+
name: Prepare CI and master release metadata
|
|
22
21
|
permissions:
|
|
23
22
|
contents: read
|
|
24
23
|
pull-requests: read
|
|
@@ -30,7 +29,6 @@ jobs:
|
|
|
30
29
|
build: ${{ steps.changes.outputs.build }}
|
|
31
30
|
new_version: ${{ steps.changes.outputs.new_version }}
|
|
32
31
|
tag: ${{ steps.changes.outputs.tag }}
|
|
33
|
-
test_required: ${{ steps.test_paths.outputs.required }}
|
|
34
32
|
steps:
|
|
35
33
|
- uses: actions/checkout@v7
|
|
36
34
|
with:
|
|
@@ -40,49 +38,22 @@ jobs:
|
|
|
40
38
|
uses: actions/setup-python@v7
|
|
41
39
|
with:
|
|
42
40
|
python-version: '3.13'
|
|
43
|
-
- name: Detect test-relevant changes
|
|
44
|
-
id: test_paths
|
|
45
|
-
run: |
|
|
46
|
-
python - <<'PY'
|
|
47
|
-
from json import loads
|
|
48
|
-
from os import environ
|
|
49
|
-
from pathlib import Path
|
|
50
|
-
from subprocess import check_output
|
|
51
|
-
|
|
52
|
-
required = True
|
|
53
|
-
if environ['GITHUB_EVENT_NAME'] == 'pull_request':
|
|
54
|
-
event = loads(Path(environ['GITHUB_EVENT_PATH']).read_text(encoding='utf-8'))
|
|
55
|
-
base = event['pull_request']['base']['sha']
|
|
56
|
-
changed = check_output([
|
|
57
|
-
'git', 'diff', '--name-only', '--no-renames', '-z',
|
|
58
|
-
f'{base}...{environ["GITHUB_SHA"]}', '--', 'samples/', 'src/', 'tests/', 'setup.py', '.github/workflows/ci.yml',
|
|
59
|
-
])
|
|
60
|
-
required = bool(changed)
|
|
61
|
-
with Path(environ['GITHUB_OUTPUT']).open('a', encoding='utf-8') as output:
|
|
62
|
-
output.write(f'required={str(required).lower()}\n')
|
|
63
|
-
print(f'Test-relevant changes: {required}')
|
|
64
|
-
PY
|
|
65
41
|
- name: Check complete push range and plan version
|
|
42
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
66
43
|
id: changes
|
|
67
44
|
env:
|
|
68
45
|
BEFORE: ${{ github.event.before }}
|
|
69
|
-
RELEASE_PUSH: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
70
46
|
run: |
|
|
71
47
|
python - <<'PY'
|
|
72
|
-
from json import loads
|
|
73
48
|
from os import environ
|
|
74
49
|
from pathlib import Path
|
|
75
50
|
from re import fullmatch
|
|
76
51
|
from subprocess import check_output
|
|
77
52
|
|
|
78
|
-
release_push = environ['RELEASE_PUSH'] == 'true'
|
|
79
53
|
series = environ['RELEASE_SERIES']
|
|
80
54
|
if fullmatch(r'(0|[1-9]\d*)\.(0|[1-9]\d*)', series) is None:
|
|
81
55
|
raise ValueError(f'Invalid RELEASE_SERIES: {series!r}')
|
|
82
56
|
before = environ['BEFORE']
|
|
83
|
-
if not release_push:
|
|
84
|
-
event = loads(Path(environ['GITHUB_EVENT_PATH']).read_text(encoding='utf-8'))
|
|
85
|
-
before = event['pull_request']['base']['sha']
|
|
86
57
|
if not before:
|
|
87
58
|
raise ValueError('Missing push base commit')
|
|
88
59
|
first_push = set(before) == {'0'}
|
|
@@ -112,8 +83,6 @@ jobs:
|
|
|
112
83
|
number = int(environ['GITHUB_RUN_NUMBER'])
|
|
113
84
|
if number < 1:
|
|
114
85
|
raise ValueError('Build number must be positive')
|
|
115
|
-
if latest is None and not changed:
|
|
116
|
-
raise ValueError('No release tag or source/packaging changes; tag the existing release before rebuilding')
|
|
117
86
|
migrate = latest is not None and latest[5]
|
|
118
87
|
new_version = bool(changed) or latest is None or migrate
|
|
119
88
|
if new_version:
|
|
@@ -125,12 +94,12 @@ jobs:
|
|
|
125
94
|
version = f'{series}.{patch}'
|
|
126
95
|
print(f'Planned version: {version}, wheel build: {number}')
|
|
127
96
|
with Path(environ['GITHUB_OUTPUT']).open('a', encoding='utf-8') as output:
|
|
128
|
-
output.write(f'release=
|
|
97
|
+
output.write(f'release=true\nversion={version}\n')
|
|
129
98
|
output.write(f'build={number}\nnew_version={str(new_version).lower()}\n')
|
|
130
99
|
output.write(f'tag={version if new_version else release_tags[latest]}\n')
|
|
131
100
|
PY
|
|
132
|
-
- name:
|
|
133
|
-
|
|
101
|
+
- name: Collect branch changelog for release
|
|
102
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
134
103
|
env:
|
|
135
104
|
GH_TOKEN: ${{ github.token }}
|
|
136
105
|
BEFORE: ${{ github.event.before }}
|
|
@@ -144,25 +113,20 @@ jobs:
|
|
|
144
113
|
from subprocess import check_output
|
|
145
114
|
|
|
146
115
|
head = environ['GITHUB_SHA']
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
]
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
and pull['base']['repo']['full_name'] == repository
|
|
162
|
-
]
|
|
163
|
-
if len(pulls) > 1:
|
|
164
|
-
raise ValueError('Multiple merged PRs found for the release commit')
|
|
165
|
-
branch = pulls[0]['head']['ref'] if pulls else 'master'
|
|
116
|
+
repository = environ['GITHUB_REPOSITORY']
|
|
117
|
+
pages = loads(check_output([
|
|
118
|
+
'gh', 'api', '--paginate', '--slurp',
|
|
119
|
+
f'repos/{repository}/commits/{head}/pulls?per_page=100',
|
|
120
|
+
]))
|
|
121
|
+
pulls = [
|
|
122
|
+
pull for page in pages for pull in page
|
|
123
|
+
if pull['merged_at'] is not None
|
|
124
|
+
and pull['merge_commit_sha'] == head
|
|
125
|
+
and pull['base']['ref'] == 'master'
|
|
126
|
+
and pull['base']['repo']['full_name'] == repository
|
|
127
|
+
]
|
|
128
|
+
if len(pulls) > 1:
|
|
129
|
+
raise ValueError('Multiple merged PRs found for the release commit')
|
|
166
130
|
if environ['NEW_VERSION'] == 'false':
|
|
167
131
|
tag = environ['RELEASE_TAG']
|
|
168
132
|
release = loads(check_output([
|
|
@@ -172,7 +136,7 @@ jobs:
|
|
|
172
136
|
raise ValueError(f'Existing release notes are missing or empty: {tag}')
|
|
173
137
|
body = release['body'].encode('utf-8')
|
|
174
138
|
print(f'Reusing release notes unchanged: {tag}')
|
|
175
|
-
elif
|
|
139
|
+
elif not pulls:
|
|
176
140
|
before = environ['BEFORE']
|
|
177
141
|
if not before:
|
|
178
142
|
raise ValueError('Missing push base commit')
|
|
@@ -181,7 +145,8 @@ jobs:
|
|
|
181
145
|
body = '## master 직접 push\n\n'.encode('utf-8') + commits
|
|
182
146
|
print('Direct master push: generating release notes from commits')
|
|
183
147
|
else:
|
|
184
|
-
|
|
148
|
+
branch = pulls[0]['head']['ref']
|
|
149
|
+
path = f'issues/{branch}/CHANGELOG.md'
|
|
185
150
|
entry = check_output(['git', 'ls-tree', head, '--', path]).decode().split()
|
|
186
151
|
if not entry or entry[0] not in ('100644', '100755'):
|
|
187
152
|
raise ValueError(f'Changelog must exist as a regular file: {path}')
|
|
@@ -192,10 +157,9 @@ jobs:
|
|
|
192
157
|
notes = Path(environ['RUNNER_TEMP'], 'release-notes', 'README.md')
|
|
193
158
|
notes.parent.mkdir(parents=True, exist_ok=True)
|
|
194
159
|
notes.write_bytes(body)
|
|
195
|
-
with Path(environ['GITHUB_OUTPUT']).open('a', encoding='utf-8') as output:
|
|
196
|
-
output.write(f'branch={branch}\n')
|
|
197
160
|
PY
|
|
198
161
|
- name: Preserve customer release notes
|
|
162
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
199
163
|
uses: actions/upload-artifact@v7
|
|
200
164
|
with:
|
|
201
165
|
name: release-notes
|
|
@@ -207,7 +171,6 @@ jobs:
|
|
|
207
171
|
test:
|
|
208
172
|
name: Test Python ${{ matrix.python }}
|
|
209
173
|
needs: changes
|
|
210
|
-
if: needs.changes.outputs.test_required == 'true'
|
|
211
174
|
runs-on: ubuntu-latest
|
|
212
175
|
timeout-minutes: 25
|
|
213
176
|
strategy:
|
|
@@ -384,7 +347,7 @@ jobs:
|
|
|
384
347
|
run: node --test packages/DefStream/tests/test_status_ui.cjs
|
|
385
348
|
|
|
386
349
|
- name: Preserve verified release distributions
|
|
387
|
-
if: needs.changes.outputs.release == 'true' && matrix.python == '3.13'
|
|
350
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.changes.outputs.release == 'true' && matrix.python == '3.13'
|
|
388
351
|
uses: actions/upload-artifact@v7
|
|
389
352
|
with:
|
|
390
353
|
name: distributions
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: DefStream
|
|
3
|
+
Version: 0.1.18
|
|
4
|
+
Summary: Synchronous message processing with pluggable broker adapters
|
|
5
|
+
Home-page: https://github.com/yong5eon/DefStream
|
|
6
|
+
Author: Heo Yongseon
|
|
7
|
+
Project-URL: Source, https://github.com/yong5eon/DefStream
|
|
8
|
+
Project-URL: Issues, https://github.com/yong5eon/DefStream/issues
|
|
9
|
+
Project-URL: Releases, https://github.com/yong5eon/DefStream/releases
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Provides-Extra: rabbitmq
|
|
20
|
+
Requires-Dist: pika>=1.3.2; extra == "rabbitmq"
|
|
21
|
+
Provides-Extra: redis
|
|
22
|
+
Requires-Dist: redis>=5.1.1; extra == "redis"
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: project-url
|
|
30
|
+
Dynamic: provides-extra
|
|
31
|
+
Dynamic: requires-python
|
|
32
|
+
Dynamic: summary
|
|
33
|
+
|
|
34
|
+
# DefStream
|
|
35
|
+
|
|
36
|
+
Synchronous event/message processing with pluggable broker adapters
|
|
37
|
+
|
|
38
|
+
DefStream processes broker messages with ordinary Python task methods and can run them in thread or process pools. It requires Python 3.9 or later.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
Install the client extra for the broker you use. A broker server must be available separately.
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
python -m pip install "DefStream[RabbitMQ]"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For Redis Streams, install `DefStream[Redis]`. To install both clients, use `DefStream[RabbitMQ,Redis]`. The plain `DefStream` installation includes neither broker client.
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
51
|
+
|
|
52
|
+
The following worker listens to a local RabbitMQ server at `127.0.0.1:5672`. The example credentials are for local development only.
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from signal import SIGINT, signal
|
|
56
|
+
|
|
57
|
+
from DefStream.Broker.Implements.RabbitMQ import Configuration, Connection, Reject, Subscription
|
|
58
|
+
from DefStream.Worker import Run, ThreadPool, Worker, WorkerSetup, declare
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class Add(
|
|
62
|
+
Run,
|
|
63
|
+
parameters=Subscription(queue='example.add', error='example.add.error'),
|
|
64
|
+
on_error=Reject(),
|
|
65
|
+
):
|
|
66
|
+
def run(self, a: int, b: int):
|
|
67
|
+
print(a + b)
|
|
68
|
+
return a + b
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class Prepare(WorkerSetup):
|
|
72
|
+
def __call__(self, worker: Worker) -> None:
|
|
73
|
+
for task in worker.tasks:
|
|
74
|
+
declare(task=task, broker=worker.broker)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
if __name__ == '__main__':
|
|
78
|
+
worker = Worker(
|
|
79
|
+
Connection(Configuration(host='127.0.0.1', port=5672, username='guest', password='guest')),
|
|
80
|
+
ThreadPool(4),
|
|
81
|
+
setups=Prepare(),
|
|
82
|
+
)
|
|
83
|
+
worker.add(Add)
|
|
84
|
+
signal(SIGINT, lambda *_: worker.stop())
|
|
85
|
+
worker.run()
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Run the script after starting RabbitMQ. The worker declares its task queue and waits for messages. Store production credentials outside source code.
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
See the `LICENSE` file included with the source distribution for the license terms.
|
|
@@ -16,6 +16,25 @@ DefStream.egg-info/SOURCES.txt
|
|
|
16
16
|
DefStream.egg-info/dependency_links.txt
|
|
17
17
|
DefStream.egg-info/requires.txt
|
|
18
18
|
DefStream.egg-info/top_level.txt
|
|
19
|
+
docs/Contracts.en.md
|
|
20
|
+
docs/Contracts.md
|
|
21
|
+
docs/GettingStarted.en.md
|
|
22
|
+
docs/GettingStarted.md
|
|
23
|
+
docs/LifecycleHooks.en.md
|
|
24
|
+
docs/LifecycleHooks.md
|
|
25
|
+
docs/Operations.en.md
|
|
26
|
+
docs/Operations.md
|
|
27
|
+
docs/README.en.md
|
|
28
|
+
docs/README.md
|
|
29
|
+
docs/RabbitMQ.en.md
|
|
30
|
+
docs/RabbitMQ.md
|
|
31
|
+
docs/Redis.en.md
|
|
32
|
+
docs/Redis.md
|
|
33
|
+
docs/Tasks.en.md
|
|
34
|
+
docs/Tasks.md
|
|
35
|
+
instructions/CODE.instructions.md
|
|
36
|
+
instructions/DOCS.instructions.md
|
|
37
|
+
instructions/README.instructions.md
|
|
19
38
|
issues/bug/16/IMPLEMENTS.md
|
|
20
39
|
issues/bug/16/ISSUE.md
|
|
21
40
|
issues/bug/16/README.md
|
|
@@ -50,16 +69,49 @@ issues/fix/26/IMPLEMENTS.md
|
|
|
50
69
|
issues/fix/26/ISSUE.md
|
|
51
70
|
issues/fix/26/README.md
|
|
52
71
|
issues/fix/26/REQUIREMENTS.md
|
|
72
|
+
issues/fix/29/ISSUE.md
|
|
73
|
+
issues/fix/29/README.md
|
|
74
|
+
issues/fix/29/REQUIREMENTS.md
|
|
75
|
+
issues/fix/29/TASK.md
|
|
53
76
|
issues/fix/3/IMPLEMENTS.md
|
|
54
77
|
issues/fix/3/README.md
|
|
55
78
|
issues/fix/3/REQUIREMENTS.md
|
|
56
79
|
issues/fix/3/ci.refs.json
|
|
80
|
+
issues/fix/41/CHANGELOG.md
|
|
81
|
+
issues/fix/41/IMPLEMENTS.md
|
|
82
|
+
issues/fix/41/PLAN.md
|
|
83
|
+
issues/fix/41/README.md
|
|
84
|
+
issues/fix/41/REQUIREMENTS.md
|
|
85
|
+
issues/fix/41/TASKS.md
|
|
86
|
+
issues/fix/41/implements/1793257519898.md
|
|
87
|
+
issues/fix/41/implements/1793257826069.md
|
|
88
|
+
issues/fix/41/tasks/1793256929057.md
|
|
89
|
+
issues/fix/41/tasks/1793256990072.md
|
|
90
|
+
issues/fix/41/tasks/1793257216492.md
|
|
91
|
+
issues/fix/41/tasks/1793257519899.md
|
|
92
|
+
issues/fix/41/tasks/1793257826068.md
|
|
57
93
|
issues/fix/6/IMPLEMENTS.md
|
|
58
94
|
issues/fix/6/README.md
|
|
59
95
|
issues/fix/6/REQUIREMENTS.md
|
|
60
96
|
issues/task/18/IMPLEMENTS.md
|
|
61
97
|
issues/task/18/README.md
|
|
62
98
|
issues/task/18/REQUIREMENTS.md
|
|
99
|
+
issues/task/32/IMPLEMENTS.md
|
|
100
|
+
issues/task/32/ISSUE.md
|
|
101
|
+
issues/task/32/PLAN.md
|
|
102
|
+
issues/task/32/README.md
|
|
103
|
+
issues/task/32/REQUIREMENTS.md
|
|
104
|
+
issues/task/32/TASK.md
|
|
105
|
+
issues/task/34/CHANGELOG.md
|
|
106
|
+
issues/task/34/IMPLEMENTS.md
|
|
107
|
+
issues/task/34/PLAN.md
|
|
108
|
+
issues/task/34/README.md
|
|
109
|
+
issues/task/34/REQUIREMENTS.md
|
|
110
|
+
issues/task/36/CHANGELOG.md
|
|
111
|
+
issues/task/36/IMPLEMENTS.md
|
|
112
|
+
issues/task/36/PLAN.md
|
|
113
|
+
issues/task/36/README.md
|
|
114
|
+
issues/task/36/REQUIREMENTS.md
|
|
63
115
|
samples/Broker/Sample.py
|
|
64
116
|
samples/Broker/RabbitMQ/Sample.RPC.py
|
|
65
117
|
samples/Broker/RabbitMQ/Sample.Stream.py
|
|
@@ -155,15 +207,12 @@ tests/test_rabbitmq_broker_methods.py
|
|
|
155
207
|
tests/test_rabbitmq_integration.py
|
|
156
208
|
tests/test_rabbitmq_logging.py
|
|
157
209
|
tests/test_rabbitmq_priorities.py
|
|
158
|
-
tests/test_rabbitmq_release_workflow.py
|
|
159
210
|
tests/test_rabbitmq_rpc.py
|
|
160
211
|
tests/test_rabbitmq_rpc_integration.py
|
|
161
212
|
tests/test_rabbitmq_worker.py
|
|
162
213
|
tests/test_redis.py
|
|
163
214
|
tests/test_redis_integration.py
|
|
164
215
|
tests/test_redis_logging.py
|
|
165
|
-
tests/test_redis_release_workflow.py
|
|
166
|
-
tests/test_release_workflow.py
|
|
167
216
|
tests/test_runner_hooks.py
|
|
168
217
|
tests/test_specifications.py
|
|
169
218
|
tests/test_status.py
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: DefStream
|
|
3
|
+
Version: 0.1.18
|
|
4
|
+
Summary: Synchronous message processing with pluggable broker adapters
|
|
5
|
+
Home-page: https://github.com/yong5eon/DefStream
|
|
6
|
+
Author: Heo Yongseon
|
|
7
|
+
Project-URL: Source, https://github.com/yong5eon/DefStream
|
|
8
|
+
Project-URL: Issues, https://github.com/yong5eon/DefStream/issues
|
|
9
|
+
Project-URL: Releases, https://github.com/yong5eon/DefStream/releases
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Provides-Extra: rabbitmq
|
|
20
|
+
Requires-Dist: pika>=1.3.2; extra == "rabbitmq"
|
|
21
|
+
Provides-Extra: redis
|
|
22
|
+
Requires-Dist: redis>=5.1.1; extra == "redis"
|
|
23
|
+
Dynamic: author
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: license-file
|
|
29
|
+
Dynamic: project-url
|
|
30
|
+
Dynamic: provides-extra
|
|
31
|
+
Dynamic: requires-python
|
|
32
|
+
Dynamic: summary
|
|
33
|
+
|
|
34
|
+
# DefStream
|
|
35
|
+
|
|
36
|
+
Synchronous event/message processing with pluggable broker adapters
|
|
37
|
+
|
|
38
|
+
DefStream processes broker messages with ordinary Python task methods and can run them in thread or process pools. It requires Python 3.9 or later.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
Install the client extra for the broker you use. A broker server must be available separately.
|
|
43
|
+
|
|
44
|
+
```shell
|
|
45
|
+
python -m pip install "DefStream[RabbitMQ]"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For Redis Streams, install `DefStream[Redis]`. To install both clients, use `DefStream[RabbitMQ,Redis]`. The plain `DefStream` installation includes neither broker client.
|
|
49
|
+
|
|
50
|
+
## Quick start
|
|
51
|
+
|
|
52
|
+
The following worker listens to a local RabbitMQ server at `127.0.0.1:5672`. The example credentials are for local development only.
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
from signal import SIGINT, signal
|
|
56
|
+
|
|
57
|
+
from DefStream.Broker.Implements.RabbitMQ import Configuration, Connection, Reject, Subscription
|
|
58
|
+
from DefStream.Worker import Run, ThreadPool, Worker, WorkerSetup, declare
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class Add(
|
|
62
|
+
Run,
|
|
63
|
+
parameters=Subscription(queue='example.add', error='example.add.error'),
|
|
64
|
+
on_error=Reject(),
|
|
65
|
+
):
|
|
66
|
+
def run(self, a: int, b: int):
|
|
67
|
+
print(a + b)
|
|
68
|
+
return a + b
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
class Prepare(WorkerSetup):
|
|
72
|
+
def __call__(self, worker: Worker) -> None:
|
|
73
|
+
for task in worker.tasks:
|
|
74
|
+
declare(task=task, broker=worker.broker)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
if __name__ == '__main__':
|
|
78
|
+
worker = Worker(
|
|
79
|
+
Connection(Configuration(host='127.0.0.1', port=5672, username='guest', password='guest')),
|
|
80
|
+
ThreadPool(4),
|
|
81
|
+
setups=Prepare(),
|
|
82
|
+
)
|
|
83
|
+
worker.add(Add)
|
|
84
|
+
signal(SIGINT, lambda *_: worker.stop())
|
|
85
|
+
worker.run()
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Run the script after starting RabbitMQ. The worker declares its task queue and waits for messages. Store production credentials outside source code.
|
|
89
|
+
|
|
90
|
+
## License
|
|
91
|
+
|
|
92
|
+
See the `LICENSE` file included with the source distribution for the license terms.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# DefStream
|
|
2
|
+
|
|
3
|
+
Synchronous event/message processing with pluggable broker adapters
|
|
4
|
+
|
|
5
|
+
**Just def.**<br>
|
|
6
|
+
**Let workers do the work.**<br>
|
|
7
|
+
**You don't need to await this.**
|
|
8
|
+
|
|
9
|
+
[한국어](./README.md) | **English**
|
|
10
|
+
|
|
11
|
+
DefStream is a synchronous library for processing broker messages with ordinary Python methods. Configure task execution, acknowledgements, failure policies, and thread or process pools without `async` / `await`.
|
|
12
|
+
|
|
13
|
+
- RabbitMQ and Redis Streams broker adapters
|
|
14
|
+
- One-way task publishing and synchronous RabbitMQ RPC
|
|
15
|
+
- Request/reply contract validation, health checks, and operational Inspector tools
|
|
16
|
+
|
|
17
|
+
## Requirements and installation
|
|
18
|
+
|
|
19
|
+
Requires Python 3.9 or later. Install the client extra for the broker you use, and provide the broker server separately.
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
python -m pip install "DefStream[RabbitMQ]"
|
|
23
|
+
python -m pip install "DefStream[Redis]"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
To install both adapters, use `python -m pip install "DefStream[RabbitMQ,Redis]"`. To install the core without broker clients, use `python -m pip install DefStream`.
|
|
27
|
+
|
|
28
|
+
## Quick start
|
|
29
|
+
|
|
30
|
+
This example uses a local RabbitMQ server at `127.0.0.1:5672`. The credentials are for local development only; use dedicated credentials in production.
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from signal import SIGINT, signal
|
|
34
|
+
|
|
35
|
+
from DefStream.Broker.Implements.RabbitMQ import Configuration, Connection, Reject, Subscription
|
|
36
|
+
from DefStream.Worker import Run, ThreadPool, Worker, WorkerSetup, declare
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Add(
|
|
40
|
+
Run,
|
|
41
|
+
parameters=Subscription(queue='example.add', error='example.add.error'),
|
|
42
|
+
on_error=Reject(),
|
|
43
|
+
):
|
|
44
|
+
def run(self, a: int, b: int):
|
|
45
|
+
print(a + b)
|
|
46
|
+
return a + b
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Prepare(WorkerSetup):
|
|
50
|
+
def __call__(self, worker: Worker) -> None:
|
|
51
|
+
for task in worker.tasks:
|
|
52
|
+
declare(task=task, broker=worker.broker)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == '__main__':
|
|
56
|
+
worker = Worker(
|
|
57
|
+
Connection(Configuration(host='127.0.0.1', port=5672, username='guest', password='guest')),
|
|
58
|
+
ThreadPool(4),
|
|
59
|
+
setups=Prepare(),
|
|
60
|
+
)
|
|
61
|
+
worker.add(Add)
|
|
62
|
+
signal(SIGINT, lambda *_: worker.stop())
|
|
63
|
+
worker.run()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The Worker waits for tasks on the `example.add` queue. See the [detailed guide](./docs/README.en.md) for publishing tasks, declaring queues, RPC, and broker-specific configuration.
|
|
67
|
+
|
|
68
|
+
## Documentation and releases
|
|
69
|
+
|
|
70
|
+
- [Detailed guide (English)](./docs/README.en.md)
|
|
71
|
+
- [Releases and change history](https://github.com/yong5eon/DefStream/releases)
|
|
72
|
+
|
|
73
|
+
DefStream is licensed under GNU GPL v3. See the repository's `LICENSE` file for the terms.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# DefStream
|
|
2
|
+
|
|
3
|
+
Synchronous event/message processing with pluggable broker adapters
|
|
4
|
+
|
|
5
|
+
**Just def.**<br>
|
|
6
|
+
**Let workers do the work.**<br>
|
|
7
|
+
**You don't need to await this.**
|
|
8
|
+
|
|
9
|
+
**한국어** | [English](./README.en.md)
|
|
10
|
+
|
|
11
|
+
DefStream은 메시지 브로커에서 받은 작업을 일반 Python 메서드로 처리하는 동기식 라이브러리입니다. `async` / `await` 없이 작업 실행, ACK와 실패 정책, 스레드·프로세스 풀을 구성할 수 있습니다.
|
|
12
|
+
|
|
13
|
+
- RabbitMQ와 Redis Streams 브로커 어댑터
|
|
14
|
+
- 단방향 작업 발행과 RabbitMQ 동기 RPC
|
|
15
|
+
- 요청·응답 계약 검증, 상태 확인과 운영용 Inspector
|
|
16
|
+
|
|
17
|
+
## 요구 사항 및 설치
|
|
18
|
+
|
|
19
|
+
Python 3.9 이상이 필요합니다. 사용할 브로커의 클라이언트 extra를 설치하고, 별도로 브로커 서버를 준비하세요.
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
python -m pip install "DefStream[RabbitMQ]"
|
|
23
|
+
python -m pip install "DefStream[Redis]"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
두 어댑터가 모두 필요하면 `python -m pip install "DefStream[RabbitMQ,Redis]"`를 사용하세요. 브로커 클라이언트 없이 코어만 설치하려면 `python -m pip install DefStream`을 사용합니다.
|
|
27
|
+
|
|
28
|
+
## 빠르게 시작하기
|
|
29
|
+
|
|
30
|
+
다음 예제는 로컬 RabbitMQ(`127.0.0.1:5672`)를 사용합니다. 사용자 이름과 암호는 로컬 개발용 예시이며 운영 환경에서는 전용 자격 증명을 사용하세요.
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
from signal import SIGINT, signal
|
|
34
|
+
|
|
35
|
+
from DefStream.Broker.Implements.RabbitMQ import Configuration, Connection, Reject, Subscription
|
|
36
|
+
from DefStream.Worker import Run, ThreadPool, Worker, WorkerSetup, declare
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Add(
|
|
40
|
+
Run,
|
|
41
|
+
parameters=Subscription(queue='example.add', error='example.add.error'),
|
|
42
|
+
on_error=Reject(),
|
|
43
|
+
):
|
|
44
|
+
def run(self, a: int, b: int):
|
|
45
|
+
print(a + b)
|
|
46
|
+
return a + b
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class Prepare(WorkerSetup):
|
|
50
|
+
def __call__(self, worker: Worker) -> None:
|
|
51
|
+
for task in worker.tasks:
|
|
52
|
+
declare(task=task, broker=worker.broker)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == '__main__':
|
|
56
|
+
worker = Worker(
|
|
57
|
+
Connection(Configuration(host='127.0.0.1', port=5672, username='guest', password='guest')),
|
|
58
|
+
ThreadPool(4),
|
|
59
|
+
setups=Prepare(),
|
|
60
|
+
)
|
|
61
|
+
worker.add(Add)
|
|
62
|
+
signal(SIGINT, lambda *_: worker.stop())
|
|
63
|
+
worker.run()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Worker는 `example.add` 큐에서 작업을 기다립니다. 작업 발행, 큐 선언, RPC 및 브로커별 설정은 [상세 매뉴얼](./docs/README.md)에서 확인하세요.
|
|
67
|
+
|
|
68
|
+
## 문서와 릴리즈
|
|
69
|
+
|
|
70
|
+
- [상세 매뉴얼 (한국어)](./docs/README.md)
|
|
71
|
+
- [릴리즈와 변경 내역](https://github.com/yong5eon/DefStream/releases)
|
|
72
|
+
|
|
73
|
+
DefStream은 GNU GPL v3 라이선스를 사용합니다. 자세한 조건은 저장소의 `LICENSE` 파일을 확인하세요.
|