-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Feature: Extend EventBus to process parallel tasks of events
Scenario 1: Setting the number of threads for parallel execution
Given the EventBus is configured for event processing
When I set the number of threads to a specific value (e.g., 4)
Then the EventBus should initialize with 4 threads
And events should be processed concurrently across the 4 threads.
Scenario 2: Handling multiple event scopes simultaneously
Given there are multiple event scopes defined (e.g., "ScopeA", "ScopeB", "ScopeC")
And the EventBus is configured for parallel execution
When events from different scopes are published concurrently
Then the EventBus should process events from each scope independently
And no single scope should block the execution of others.
Scenario 3: Limiting parallel executions
Given the EventBus is configured with a limit of 2 parallel executions
When more than 2 events are published simultaneously
Then the EventBus should process 2 events concurrently
And the remaining events should queue until threads are available.
Scenario 4: Validating default behavior
Given the number of threads and parallel executions are not explicitly set
When the EventBus starts processing events
Then it should default to a single-threaded mode
And events should be processed one at a time in sequential order.
Scenario 5: Error handling in parallel execution
Given the EventBus is processing multiple events in parallel
And one event processing task fails with an error
When other tasks are still running
Then the EventBus should log the error for the failed task
And continue processing the remaining tasks without interruption.
Scenario 6: Updating thread count dynamically
Given the EventBus is running with a thread count of 2
When I update the thread count to 5 dynamically
Then the EventBus should adjust its configuration to use 5 threads
And process events using the updated thread count.