haiway 0.24.1__tar.gz → 0.24.3__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.
Files changed (74) hide show
  1. {haiway-0.24.1 → haiway-0.24.3}/PKG-INFO +1 -1
  2. {haiway-0.24.1 → haiway-0.24.3}/junit/test-results.xml +1 -1
  3. {haiway-0.24.1 → haiway-0.24.3}/pyproject.toml +1 -1
  4. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/__init__.py +2 -0
  5. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/__init__.py +6 -1
  6. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/concurrent.py +12 -12
  7. {haiway-0.24.1 → haiway-0.24.3}/tests/test_execute_concurrently.py +30 -12
  8. {haiway-0.24.1 → haiway-0.24.3}/uv.lock +1 -1
  9. {haiway-0.24.1 → haiway-0.24.3}/.claude/settings.json +0 -0
  10. {haiway-0.24.1 → haiway-0.24.3}/.github/workflows/ci.yml +0 -0
  11. {haiway-0.24.1 → haiway-0.24.3}/.github/workflows/publish.yml +0 -0
  12. {haiway-0.24.1 → haiway-0.24.3}/.gitignore +0 -0
  13. {haiway-0.24.1 → haiway-0.24.3}/CLAUDE.md +0 -0
  14. {haiway-0.24.1 → haiway-0.24.3}/LICENSE +0 -0
  15. {haiway-0.24.1 → haiway-0.24.3}/Makefile +0 -0
  16. {haiway-0.24.1 → haiway-0.24.3}/README.md +0 -0
  17. {haiway-0.24.1 → haiway-0.24.3}/config/pre-push +0 -0
  18. {haiway-0.24.1 → haiway-0.24.3}/guidelines/functionalities.md +0 -0
  19. {haiway-0.24.1 → haiway-0.24.3}/guidelines/llms.txt +0 -0
  20. {haiway-0.24.1 → haiway-0.24.3}/guidelines/packages.md +0 -0
  21. {haiway-0.24.1 → haiway-0.24.3}/guidelines/state.md +0 -0
  22. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/__init__.py +0 -0
  23. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/access.py +0 -0
  24. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/disposables.py +0 -0
  25. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/identifier.py +0 -0
  26. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/observability.py +0 -0
  27. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/state.py +0 -0
  28. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/tasks.py +0 -0
  29. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/context/types.py +0 -0
  30. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/asynchrony.py +0 -0
  31. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/caching.py +0 -0
  32. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/files.py +0 -0
  33. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/observability.py +0 -0
  34. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/retries.py +0 -0
  35. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/throttling.py +0 -0
  36. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/timeouting.py +0 -0
  37. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/helpers/tracing.py +0 -0
  38. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/opentelemetry/__init__.py +0 -0
  39. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/opentelemetry/observability.py +0 -0
  40. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/py.typed +0 -0
  41. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/state/__init__.py +0 -0
  42. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/state/attributes.py +0 -0
  43. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/state/path.py +0 -0
  44. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/state/requirement.py +0 -0
  45. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/state/structure.py +0 -0
  46. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/state/validation.py +0 -0
  47. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/types/__init__.py +0 -0
  48. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/types/default.py +0 -0
  49. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/types/missing.py +0 -0
  50. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/__init__.py +0 -0
  51. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/always.py +0 -0
  52. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/collections.py +0 -0
  53. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/env.py +0 -0
  54. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/formatting.py +0 -0
  55. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/logs.py +0 -0
  56. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/mimic.py +0 -0
  57. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/noop.py +0 -0
  58. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/queue.py +0 -0
  59. {haiway-0.24.1 → haiway-0.24.3}/src/haiway/utils/stream.py +0 -0
  60. {haiway-0.24.1 → haiway-0.24.3}/tests/__init__.py +0 -0
  61. {haiway-0.24.1 → haiway-0.24.3}/tests/test_async_queue.py +0 -0
  62. {haiway-0.24.1 → haiway-0.24.3}/tests/test_async_stream.py +0 -0
  63. {haiway-0.24.1 → haiway-0.24.3}/tests/test_attribute_path.py +0 -0
  64. {haiway-0.24.1 → haiway-0.24.3}/tests/test_attribute_requirement.py +0 -0
  65. {haiway-0.24.1 → haiway-0.24.3}/tests/test_auto_retry.py +0 -0
  66. {haiway-0.24.1 → haiway-0.24.3}/tests/test_cache.py +0 -0
  67. {haiway-0.24.1 → haiway-0.24.3}/tests/test_context.py +0 -0
  68. {haiway-0.24.1 → haiway-0.24.3}/tests/test_disposables.py +0 -0
  69. {haiway-0.24.1 → haiway-0.24.3}/tests/test_process_concurrently.py +0 -0
  70. {haiway-0.24.1 → haiway-0.24.3}/tests/test_state.py +0 -0
  71. {haiway-0.24.1 → haiway-0.24.3}/tests/test_state_validation.py +0 -0
  72. {haiway-0.24.1 → haiway-0.24.3}/tests/test_stream_concurrently.py +0 -0
  73. {haiway-0.24.1 → haiway-0.24.3}/tests/test_streaming.py +0 -0
  74. {haiway-0.24.1 → haiway-0.24.3}/tests/test_timeout.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haiway
3
- Version: 0.24.1
3
+ Version: 0.24.3
4
4
  Summary: Framework for dependency injection and state management within structured concurrency model.
5
5
  Project-URL: Homepage, https://miquido.com
6
6
  Project-URL: Repository, https://github.com/miquido/haiway.git
@@ -1 +1 @@
1
- <?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="180" time="3.753" timestamp="2025-07-07T16:07:26.640817+00:00" hostname="pkrvmbietmlfzoi"><testcase classname="tests.test_async_queue" name="test_fails_when_stream_fails" time="0.001" /><testcase classname="tests.test_async_queue" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_queue" name="test_buffers_values_when_not_reading" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_buffer_when_streaming_fails" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_queue" name="test_fails_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_fails_when_stream_fails" time="0.001" /><testcase classname="tests.test_async_stream" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_stream" name="test_finishes_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_fails_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_failed" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_all_when_sending_async" time="0.001" /><testcase classname="tests.test_attribute_path" name="test_id_path_points_to_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_points_to_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_id_path_set_updates_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_set_updates_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_equal_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_not_equal_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_contains_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_contains_any_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_contained_in_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_logical_and_or_requirements" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_filter" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_immutability" time="0.000" /><testcase classname="tests.test_auto_retry" name="test_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_when_cancelled" time="0.021" /><testcase classname="tests.test_auto_retry" name="test_async_uses_delay_with_errors" time="0.101" /><testcase classname="tests.test_auto_retry" name="test_async_uses_computed_delay_with_errors" time="0.107" /><testcase classname="tests.test_auto_retry" name="test_async_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_cache_value_with_same_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_different_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_limit_exceed" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_same_value_with_repeating_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_fails_with_error" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_expiration_time_exceed" time="0.020" /><testcase classname="tests.test_cache" name="test_async_returns_cache_value_with_same_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_different_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_limit_exceed" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_same_value_with_repeating_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_expiration_time_exceed" time="0.021" /><testcase classname="tests.test_cache" name="test_async_cancel_waiting_does_not_cancel_task" time="0.502" /><testcase classname="tests.test_cache" name="test_async_expiration_does_not_cancel_task" time="0.021" /><testcase classname="tests.test_cache" name="test_async_fails_with_error" time="0.001" /><testcase classname="tests.test_context" name="test_state_is_available_according_to_context" time="0.001" /><testcase classname="tests.test_context" name="test_state_update_updates_local_context" time="0.001" /><testcase classname="tests.test_context" name="test_exceptions_are_propagated" time="0.001" /><testcase classname="tests.test_disposables" name="test_empty_initialization" time="0.000" /><testcase classname="tests.test_disposables" name="test_single_disposable_initialization" time="0.000" /><testcase classname="tests.test_disposables" name="test_multiple_disposables_initialization" time="0.000" /><testcase classname="tests.test_disposables" name="test_cannot_set_attributes" time="0.000" /><testcase classname="tests.test_disposables" name="test_cannot_delete_attributes" time="0.000" /><testcase classname="tests.test_disposables" name="test_empty_disposables_is_falsy" time="0.000" /><testcase classname="tests.test_disposables" name="test_non_empty_disposables_is_truthy" time="0.000" /><testcase classname="tests.test_disposables" name="test_setup_with_no_disposables" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_disposable_returning_none" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_disposable_returning_single_state" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_disposable_returning_multiple_states" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_multiple_disposables_mixed_returns" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_sets_loop_correctly" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_no_disposables" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_successful_cleanup" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_exception_context" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_multiple_exceptions_creates_group" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_single_exception_is_risen" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_resets_loop_even_on_exception" time="0.001" /><testcase classname="tests.test_disposables" name="test_same_loop_cleanup" time="0.001" /><testcase classname="tests.test_disposables" name="test_with_real_async_context_managers" time="0.001" /><testcase classname="tests.test_disposables" name="test_nested_disposables_usage" time="0.001" /><testcase classname="tests.test_disposables" name="test_exception_during_setup_phase" time="0.001" /><testcase classname="tests.test_disposables" name="test_assertion_on_doubleprepare" time="0.001" /><testcase classname="tests.test_disposables" name="test_assertion_on_dispose_withoutprepare" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_processes_all_elements" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_preserves_order" time="0.302" /><testcase classname="tests.test_execute_concurrently" name="test_handles_empty_collection" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_propagates_handler_exceptions" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_returns_exceptions_when_configured" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_cancels_running_tasks_on_cancellation" time="0.101" /><testcase classname="tests.test_execute_concurrently" name="test_respects_concurrency_limit" time="0.202" /><testcase classname="tests.test_execute_concurrently" name="test_works_with_different_types" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_handles_mixed_success_and_failure" time="0.002" /><testcase classname="tests.test_execute_concurrently" name="test_works_with_sets_and_tuples" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_exception_details_preserved" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_processes_all_elements" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_processes_elements_concurrently" time="0.302" /><testcase classname="tests.test_process_concurrently" name="test_handles_empty_source" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_propagates_handler_exceptions" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_ignores_handler_exceptions_when_configured" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_handles_source_exception" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_cancels_running_tasks_on_cancellation" time="0.101" /><testcase classname="tests.test_process_concurrently" name="test_respects_concurrency_limit" time="0.202" /><testcase classname="tests.test_process_concurrently" name="test_processes_elements_from_queue" time="0.052" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments" time="0.002" /><testcase classname="tests.test_state" name="test_basic_initializes_with_defaults" time="0.001" /><testcase classname="tests.test_state" name="test_basic_equals_checks_properties" time="0.000" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments_and_defaults" time="0.000" /><testcase classname="tests.test_state" name="test_parametrized_initializes_with_proper_parameters" time="0.000" /><testcase classname="tests.test_state" name="test_nested_initializes_with_proper_arguments" time="0.001" /><testcase classname="tests.test_state" name="test_dict_skips_missing_properties" time="0.001" /><testcase classname="tests.test_state" name="test_initialization_allows_missing_properties" time="0.000" /><testcase classname="tests.test_state" name="test_generic_subtypes_validation" time="0.002" /><testcase classname="tests.test_state" name="test_copying_leaves_same_object" time="0.000" /><testcase classname="tests.test_state" name="test_hash_consistency_with_missing_values" time="0.000" /><testcase classname="tests.test_state" name="test_hash_with_unhashable_attributes" time="0.001" /><testcase classname="tests.test_state" name="test_hash_with_dict_key_order_independence" time="0.000" /><testcase classname="tests.test_state" name="test_hash_with_custom_objects" time="0.000" /><testcase classname="tests.test_state" name="test_hash_performance_with_many_attributes" time="0.001" /><testcase classname="tests.test_state" name="test_hash_with_nested_unhashable_collections" time="0.000" /><testcase classname="tests.test_state" name="test_hash_stability_across_instances" time="0.000" /><testcase classname="tests.test_state" name="test_hash_excludes_missing_values" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_basic_types" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_none_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_missing_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_literal_type" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_enum_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_sequence_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_set_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_mapping_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_tuple_type" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_union_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_callable_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_typed_dict" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_state_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_complex_types" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_recursive_state" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_generic_state" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validation_error_messages" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validation_any_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_with_defaults" time="0.000" /><testcase classname="tests.test_state_validation" name="test_attribute_validator_direct_usage" time="0.000" /><testcase classname="tests.test_state_validation" name="test_unsupported_type_annotation" time="0.000" /><testcase classname="tests.test_stream_concurrently" name="test_merges_two_streams" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_interleaves_based_on_timing" time="0.152" /><testcase classname="tests.test_stream_concurrently" name="test_handles_empty_iterators" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_handles_different_lengths" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_propagates_exceptions_from_source_a" time="0.012" /><testcase classname="tests.test_stream_concurrently" name="test_propagates_exceptions_from_source_b" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_cancellation_cancels_both_sources" time="0.202" /><testcase classname="tests.test_stream_concurrently" name="test_works_with_different_types" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_immediate_yield" time="0.601" /><testcase classname="tests.test_stream_concurrently" name="test_concurrent_execution" time="0.201" /><testcase classname="tests.test_streaming" name="test_fails_when_generator_fails" time="0.001" /><testcase classname="tests.test_streaming" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_streaming" name="test_ends_when_generator_ends" time="0.001" /><testcase classname="tests.test_streaming" name="test_delivers_updates_when_generating" time="0.001" /><testcase classname="tests.test_streaming" name="test_streaming_context_variables_access_is_preserved" time="0.001" /><testcase classname="tests.test_streaming" name="test_nested_streaming_streams_correctly" time="0.001" /><testcase classname="tests.test_timeout" name="test_returns_result_when_returning_value" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_error" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_cancel" time="0.011" /><testcase classname="tests.test_timeout" name="test_raises_with_timeout" time="0.011" /></testsuite></testsuites>
1
+ <?xml version="1.0" encoding="utf-8"?><testsuites name="pytest tests"><testsuite name="pytest" errors="0" failures="0" skipped="0" tests="180" time="3.772" timestamp="2025-07-07T16:54:30.849557+00:00" hostname="pkrvmbietmlfzoi"><testcase classname="tests.test_async_queue" name="test_fails_when_stream_fails" time="0.001" /><testcase classname="tests.test_async_queue" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_queue" name="test_buffers_values_when_not_reading" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_buffer_when_streaming_fails" time="0.001" /><testcase classname="tests.test_async_queue" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_queue" name="test_fails_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_queue" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_fails_when_stream_fails" time="0.001" /><testcase classname="tests.test_async_stream" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ends_when_stream_ends" time="0.001" /><testcase classname="tests.test_async_stream" name="test_finishes_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_fails_without_buffer" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_updates_when_sending" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_sending_to_failed" time="0.001" /><testcase classname="tests.test_async_stream" name="test_ignores_when_finishing_when_finished" time="0.001" /><testcase classname="tests.test_async_stream" name="test_delivers_all_when_sending_async" time="0.001" /><testcase classname="tests.test_attribute_path" name="test_id_path_points_to_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_points_to_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_path_points_to_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_points_to_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_id_path_set_updates_self" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_attribute_path_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_nested_attribute_path_set_updates_nested_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_recursive_attribute_set_updates_attribute" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_list_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_tuple_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_mixed_tuple_item_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_path" name="test_dict_item_path_set_updates_item" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_equal_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_not_equal_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_contains_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_contains_any_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_contained_in_requirement" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_logical_and_or_requirements" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_filter" time="0.000" /><testcase classname="tests.test_attribute_requirement" name="test_immutability" time="0.000" /><testcase classname="tests.test_auto_retry" name="test_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_returns_value_without_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_exceeding_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_cancellation" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_when_cancelled" time="0.021" /><testcase classname="tests.test_auto_retry" name="test_async_uses_delay_with_errors" time="0.101" /><testcase classname="tests.test_auto_retry" name="test_async_uses_computed_delay_with_errors" time="0.107" /><testcase classname="tests.test_auto_retry" name="test_async_logs_issue_with_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_retries_with_selected_errors" time="0.001" /><testcase classname="tests.test_auto_retry" name="test_async_fails_with_not_selected_errors" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_cache_value_with_same_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_different_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_limit_exceed" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_same_value_with_repeating_argument" time="0.000" /><testcase classname="tests.test_cache" name="test_fails_with_error" time="0.000" /><testcase classname="tests.test_cache" name="test_returns_fresh_value_with_expiration_time_exceed" time="0.021" /><testcase classname="tests.test_cache" name="test_async_returns_cache_value_with_same_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_different_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_limit_exceed" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_same_value_with_repeating_argument" time="0.001" /><testcase classname="tests.test_cache" name="test_async_returns_fresh_value_with_expiration_time_exceed" time="0.021" /><testcase classname="tests.test_cache" name="test_async_cancel_waiting_does_not_cancel_task" time="0.502" /><testcase classname="tests.test_cache" name="test_async_expiration_does_not_cancel_task" time="0.021" /><testcase classname="tests.test_cache" name="test_async_fails_with_error" time="0.001" /><testcase classname="tests.test_context" name="test_state_is_available_according_to_context" time="0.001" /><testcase classname="tests.test_context" name="test_state_update_updates_local_context" time="0.001" /><testcase classname="tests.test_context" name="test_exceptions_are_propagated" time="0.001" /><testcase classname="tests.test_disposables" name="test_empty_initialization" time="0.000" /><testcase classname="tests.test_disposables" name="test_single_disposable_initialization" time="0.000" /><testcase classname="tests.test_disposables" name="test_multiple_disposables_initialization" time="0.000" /><testcase classname="tests.test_disposables" name="test_cannot_set_attributes" time="0.000" /><testcase classname="tests.test_disposables" name="test_cannot_delete_attributes" time="0.000" /><testcase classname="tests.test_disposables" name="test_empty_disposables_is_falsy" time="0.000" /><testcase classname="tests.test_disposables" name="test_non_empty_disposables_is_truthy" time="0.000" /><testcase classname="tests.test_disposables" name="test_setup_with_no_disposables" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_disposable_returning_none" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_disposable_returning_single_state" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_disposable_returning_multiple_states" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_with_multiple_disposables_mixed_returns" time="0.001" /><testcase classname="tests.test_disposables" name="test_setup_sets_loop_correctly" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_no_disposables" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_successful_cleanup" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_exception_context" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_multiple_exceptions_creates_group" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_with_single_exception_is_risen" time="0.001" /><testcase classname="tests.test_disposables" name="test_dispose_resets_loop_even_on_exception" time="0.001" /><testcase classname="tests.test_disposables" name="test_same_loop_cleanup" time="0.001" /><testcase classname="tests.test_disposables" name="test_with_real_async_context_managers" time="0.001" /><testcase classname="tests.test_disposables" name="test_nested_disposables_usage" time="0.001" /><testcase classname="tests.test_disposables" name="test_exception_during_setup_phase" time="0.001" /><testcase classname="tests.test_disposables" name="test_assertion_on_doubleprepare" time="0.001" /><testcase classname="tests.test_disposables" name="test_assertion_on_dispose_withoutprepare" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_processes_all_elements" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_preserves_order" time="0.302" /><testcase classname="tests.test_execute_concurrently" name="test_handles_empty_collection" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_propagates_handler_exceptions" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_returns_exceptions_when_configured" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_cancels_running_tasks_on_cancellation" time="0.101" /><testcase classname="tests.test_execute_concurrently" name="test_respects_concurrency_limit" time="0.202" /><testcase classname="tests.test_execute_concurrently" name="test_works_with_different_types" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_handles_mixed_success_and_failure" time="0.002" /><testcase classname="tests.test_execute_concurrently" name="test_works_with_sets_and_tuples" time="0.001" /><testcase classname="tests.test_execute_concurrently" name="test_exception_details_preserved" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_processes_all_elements" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_processes_elements_concurrently" time="0.302" /><testcase classname="tests.test_process_concurrently" name="test_handles_empty_source" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_propagates_handler_exceptions" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_ignores_handler_exceptions_when_configured" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_handles_source_exception" time="0.001" /><testcase classname="tests.test_process_concurrently" name="test_cancels_running_tasks_on_cancellation" time="0.101" /><testcase classname="tests.test_process_concurrently" name="test_respects_concurrency_limit" time="0.202" /><testcase classname="tests.test_process_concurrently" name="test_processes_elements_from_queue" time="0.052" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments" time="0.002" /><testcase classname="tests.test_state" name="test_basic_initializes_with_defaults" time="0.001" /><testcase classname="tests.test_state" name="test_basic_equals_checks_properties" time="0.000" /><testcase classname="tests.test_state" name="test_basic_initializes_with_arguments_and_defaults" time="0.000" /><testcase classname="tests.test_state" name="test_parametrized_initializes_with_proper_parameters" time="0.000" /><testcase classname="tests.test_state" name="test_nested_initializes_with_proper_arguments" time="0.001" /><testcase classname="tests.test_state" name="test_dict_skips_missing_properties" time="0.000" /><testcase classname="tests.test_state" name="test_initialization_allows_missing_properties" time="0.000" /><testcase classname="tests.test_state" name="test_generic_subtypes_validation" time="0.002" /><testcase classname="tests.test_state" name="test_copying_leaves_same_object" time="0.000" /><testcase classname="tests.test_state" name="test_hash_consistency_with_missing_values" time="0.001" /><testcase classname="tests.test_state" name="test_hash_with_unhashable_attributes" time="0.001" /><testcase classname="tests.test_state" name="test_hash_with_dict_key_order_independence" time="0.000" /><testcase classname="tests.test_state" name="test_hash_with_custom_objects" time="0.000" /><testcase classname="tests.test_state" name="test_hash_performance_with_many_attributes" time="0.000" /><testcase classname="tests.test_state" name="test_hash_with_nested_unhashable_collections" time="0.000" /><testcase classname="tests.test_state" name="test_hash_stability_across_instances" time="0.000" /><testcase classname="tests.test_state" name="test_hash_excludes_missing_values" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_basic_types" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_none_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_missing_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_literal_type" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_enum_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_sequence_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_set_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_mapping_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_tuple_type" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_union_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_callable_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_typed_dict" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_state_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_complex_types" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validator_recursive_state" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_generic_state" time="0.001" /><testcase classname="tests.test_state_validation" name="test_validation_error_messages" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validation_any_type" time="0.000" /><testcase classname="tests.test_state_validation" name="test_validator_with_defaults" time="0.000" /><testcase classname="tests.test_state_validation" name="test_attribute_validator_direct_usage" time="0.000" /><testcase classname="tests.test_state_validation" name="test_unsupported_type_annotation" time="0.000" /><testcase classname="tests.test_stream_concurrently" name="test_merges_two_streams" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_interleaves_based_on_timing" time="0.152" /><testcase classname="tests.test_stream_concurrently" name="test_handles_empty_iterators" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_handles_different_lengths" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_propagates_exceptions_from_source_a" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_propagates_exceptions_from_source_b" time="0.011" /><testcase classname="tests.test_stream_concurrently" name="test_cancellation_cancels_both_sources" time="0.202" /><testcase classname="tests.test_stream_concurrently" name="test_works_with_different_types" time="0.001" /><testcase classname="tests.test_stream_concurrently" name="test_immediate_yield" time="0.601" /><testcase classname="tests.test_stream_concurrently" name="test_concurrent_execution" time="0.201" /><testcase classname="tests.test_streaming" name="test_fails_when_generator_fails" time="0.001" /><testcase classname="tests.test_streaming" name="test_cancels_when_iteration_cancels" time="0.001" /><testcase classname="tests.test_streaming" name="test_ends_when_generator_ends" time="0.001" /><testcase classname="tests.test_streaming" name="test_delivers_updates_when_generating" time="0.001" /><testcase classname="tests.test_streaming" name="test_streaming_context_variables_access_is_preserved" time="0.001" /><testcase classname="tests.test_streaming" name="test_nested_streaming_streams_correctly" time="0.001" /><testcase classname="tests.test_timeout" name="test_returns_result_when_returning_value" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_error" time="0.001" /><testcase classname="tests.test_timeout" name="test_raises_with_cancel" time="0.011" /><testcase classname="tests.test_timeout" name="test_raises_with_timeout" time="0.011" /></testsuite></testsuites>
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
5
5
  [project]
6
6
  name = "haiway"
7
7
  description = "Framework for dependency injection and state management within structured concurrency model."
8
- version = "0.24.1"
8
+ version = "0.24.3"
9
9
  readme = "README.md"
10
10
  maintainers = [
11
11
  { name = "Kacper Kaliński", email = "kacper.kalinski@miquido.com" },
@@ -21,6 +21,7 @@ from haiway.helpers import (
21
21
  execute_concurrently,
22
22
  process_concurrently,
23
23
  retry,
24
+ stream_concurrently,
24
25
  throttle,
25
26
  timeout,
26
27
  traced,
@@ -105,6 +106,7 @@ __all__ = (
105
106
  "process_concurrently",
106
107
  "retry",
107
108
  "setup_logging",
109
+ "stream_concurrently",
108
110
  "throttle",
109
111
  "timeout",
110
112
  "traced",
@@ -1,6 +1,10 @@
1
1
  from haiway.helpers.asynchrony import asynchronous
2
2
  from haiway.helpers.caching import CacheMakeKey, CacheRead, CacheWrite, cache
3
- from haiway.helpers.concurrent import execute_concurrently, process_concurrently
3
+ from haiway.helpers.concurrent import (
4
+ execute_concurrently,
5
+ process_concurrently,
6
+ stream_concurrently,
7
+ )
4
8
  from haiway.helpers.files import File, FileAccess
5
9
  from haiway.helpers.observability import LoggerObservability
6
10
  from haiway.helpers.retries import retry
@@ -20,6 +24,7 @@ __all__ = (
20
24
  "execute_concurrently",
21
25
  "process_concurrently",
22
26
  "retry",
27
+ "stream_concurrently",
23
28
  "throttle",
24
29
  "timeout",
25
30
  "traced",
@@ -130,9 +130,9 @@ async def process_concurrently[Element]( # noqa: C901, PLR0912
130
130
 
131
131
  @overload
132
132
  async def execute_concurrently[Element, Result](
133
- source: Collection[Element],
134
- /,
135
133
  handler: Callable[[Element], Coroutine[Any, Any, Result]],
134
+ /,
135
+ elements: Collection[Element],
136
136
  *,
137
137
  concurrent_tasks: int = 2,
138
138
  ) -> Sequence[Result]: ...
@@ -140,9 +140,9 @@ async def execute_concurrently[Element, Result](
140
140
 
141
141
  @overload
142
142
  async def execute_concurrently[Element, Result](
143
- source: Collection[Element],
144
- /,
145
143
  handler: Callable[[Element], Coroutine[Any, Any, Result]],
144
+ /,
145
+ elements: Collection[Element],
146
146
  *,
147
147
  concurrent_tasks: int = 2,
148
148
  return_exceptions: Literal[True],
@@ -150,9 +150,9 @@ async def execute_concurrently[Element, Result](
150
150
 
151
151
 
152
152
  async def execute_concurrently[Element, Result]( # noqa: C901
153
- source: Collection[Element],
154
- /,
155
153
  handler: Callable[[Element], Coroutine[Any, Any, Result]],
154
+ /,
155
+ elements: Collection[Element],
156
156
  *,
157
157
  concurrent_tasks: int = 2,
158
158
  return_exceptions: bool = False,
@@ -173,11 +173,11 @@ async def execute_concurrently[Element, Result]( # noqa: C901
173
173
 
174
174
  Parameters
175
175
  ----------
176
- source : Collection[Element]
177
- A collection of elements to process. The collection size determines
178
- the result sequence length.
179
176
  handler : Callable[[Element], Coroutine[Any, Any, Result]]
180
177
  A coroutine function that processes each element and returns a result.
178
+ elements : Collection[Element]
179
+ A collection of elements to process. The collection size determines
180
+ the result sequence length.
181
181
  concurrent_tasks : int, default=2
182
182
  Maximum number of concurrent tasks. Must be greater than 0. Higher
183
183
  values allow more parallelism but consume more resources.
@@ -206,16 +206,16 @@ async def execute_concurrently[Element, Result]( # noqa: C901
206
206
  ...
207
207
  >>> urls = ["http://api.example.com/1", "http://api.example.com/2"]
208
208
  >>> results = await execute_concurrently(
209
- ... urls,
210
209
  ... fetch_data,
210
+ ... urls,
211
211
  ... concurrent_tasks=10
212
212
  ... )
213
213
  >>> # results[0] corresponds to urls[0], results[1] to urls[1], etc.
214
214
 
215
215
  >>> # With exception handling
216
216
  >>> results = await execute_concurrently(
217
- ... urls,
218
217
  ... fetch_data,
218
+ ... urls,
219
219
  ... concurrent_tasks=10,
220
220
  ... return_exceptions=True
221
221
  ... )
@@ -230,7 +230,7 @@ async def execute_concurrently[Element, Result]( # noqa: C901
230
230
  running: set[Task[Result]] = set()
231
231
  results: MutableSequence[Task[Result]] = []
232
232
  try:
233
- for element in source:
233
+ for element in elements:
234
234
  task: Task[Result] = ctx.spawn(handler, element)
235
235
  results.append(task)
236
236
  running.add(task)
@@ -20,7 +20,10 @@ async def test_processes_all_elements():
20
20
  return element * 2
21
21
 
22
22
  elements = list(range(10))
23
- results = await execute_concurrently(elements, handler)
23
+ results = await execute_concurrently(
24
+ handler,
25
+ elements,
26
+ )
24
27
  assert list(results) == [i * 2 for i in range(10)]
25
28
 
26
29
 
@@ -32,7 +35,7 @@ async def test_preserves_order():
32
35
  return element * 2
33
36
 
34
37
  elements = list(range(10))
35
- results = await execute_concurrently(elements, handler, concurrent_tasks=3)
38
+ results = await execute_concurrently(handler, elements, concurrent_tasks=3)
36
39
  # Results should be in the same order as inputs despite different processing times
37
40
  assert list(results) == [i * 2 for i in range(10)]
38
41
 
@@ -42,7 +45,10 @@ async def test_handles_empty_collection():
42
45
  async def handler(element: int) -> int:
43
46
  return element * 2
44
47
 
45
- results = await execute_concurrently([], handler)
48
+ results = await execute_concurrently(
49
+ handler,
50
+ [],
51
+ )
46
52
  assert list(results) == []
47
53
 
48
54
 
@@ -55,7 +61,10 @@ async def test_propagates_handler_exceptions():
55
61
 
56
62
  elements = list(range(10))
57
63
  with raises(FakeException):
58
- await execute_concurrently(elements, handler)
64
+ await execute_concurrently(
65
+ handler,
66
+ elements,
67
+ )
59
68
 
60
69
 
61
70
  @mark.asyncio
@@ -66,7 +75,7 @@ async def test_returns_exceptions_when_configured():
66
75
  return element * 2
67
76
 
68
77
  elements = list(range(6))
69
- results = await execute_concurrently(elements, handler, return_exceptions=True)
78
+ results = await execute_concurrently(handler, elements, return_exceptions=True)
70
79
 
71
80
  # Check that we got all results
72
81
  assert len(results) == 6
@@ -98,8 +107,8 @@ async def test_cancels_running_tasks_on_cancellation():
98
107
  with raises(CancelledError):
99
108
  task = ctx.spawn(
100
109
  execute_concurrently,
101
- list(range(10)),
102
110
  slow_handler,
111
+ list(range(10)),
103
112
  )
104
113
  # Give some time for tasks to start
105
114
  await sleep(0.1)
@@ -126,7 +135,7 @@ async def test_respects_concurrency_limit():
126
135
  return element * 2
127
136
 
128
137
  elements = list(range(10))
129
- results = await execute_concurrently(elements, tracking_handler, concurrent_tasks=3)
138
+ results = await execute_concurrently(tracking_handler, elements, concurrent_tasks=3)
130
139
  assert max_concurrent <= 3
131
140
  assert list(results) == [i * 2 for i in range(10)]
132
141
  assert currently_running == set()
@@ -138,7 +147,10 @@ async def test_works_with_different_types():
138
147
  return len(element)
139
148
 
140
149
  words = ["hello", "world", "test", "async"]
141
- results = await execute_concurrently(words, handler)
150
+ results = await execute_concurrently(
151
+ handler,
152
+ words,
153
+ )
142
154
  assert list(results) == [5, 5, 4, 5]
143
155
 
144
156
 
@@ -150,7 +162,7 @@ async def test_handles_mixed_success_and_failure():
150
162
  return f"Success: {element}"
151
163
 
152
164
  elements = list(range(10))
153
- results = await execute_concurrently(elements, handler, return_exceptions=True)
165
+ results = await execute_concurrently(handler, elements, return_exceptions=True)
154
166
 
155
167
  for i, result in enumerate(results):
156
168
  if i % 3 == 0:
@@ -167,13 +179,19 @@ async def test_works_with_sets_and_tuples():
167
179
 
168
180
  # Test with set (unordered collection)
169
181
  elements_set = {1, 2, 3, 4, 5}
170
- results_set = await execute_concurrently(elements_set, handler)
182
+ results_set = await execute_concurrently(
183
+ handler,
184
+ elements_set,
185
+ )
171
186
  # Convert to set for comparison since order isn't guaranteed with input sets
172
187
  assert set(results_set) == {1, 4, 9, 16, 25}
173
188
 
174
189
  # Test with tuple (ordered collection)
175
190
  elements_tuple = (1, 2, 3, 4, 5)
176
- results_tuple = await execute_concurrently(elements_tuple, handler)
191
+ results_tuple = await execute_concurrently(
192
+ handler,
193
+ elements_tuple,
194
+ )
177
195
  assert list(results_tuple) == [1, 4, 9, 16, 25]
178
196
 
179
197
 
@@ -189,7 +207,7 @@ async def test_exception_details_preserved():
189
207
  raise CustomError(404, "Not found")
190
208
  return element
191
209
 
192
- results = await execute_concurrently([1, 2, 3], handler, return_exceptions=True)
210
+ results = await execute_concurrently(handler, [1, 2, 3], return_exceptions=True)
193
211
 
194
212
  assert results[0] == 1
195
213
  assert isinstance(results[1], CustomError)
@@ -114,7 +114,7 @@ wheels = [
114
114
 
115
115
  [[package]]
116
116
  name = "haiway"
117
- version = "0.24.1"
117
+ version = "0.24.3"
118
118
  source = { editable = "." }
119
119
 
120
120
  [package.optional-dependencies]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes