mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-21 05:48:14 +00:00
Rename event_bus to crewai_event_bus for improved clarity and specificity
- Replace all references to `event_bus` with `crewai_event_bus` - Update import statements across multiple files - Remove the old `event_bus.py` file - Maintain existing event handling functionality
This commit is contained in:
@@ -12,7 +12,7 @@ from crewai.utilities.events import (
|
||||
FlowStartedEvent,
|
||||
MethodExecutionFinishedEvent,
|
||||
MethodExecutionStartedEvent,
|
||||
event_bus,
|
||||
crewai_event_bus,
|
||||
)
|
||||
|
||||
|
||||
@@ -440,15 +440,15 @@ def test_unstructured_flow_event_emission():
|
||||
flow = PoemFlow()
|
||||
received_events = []
|
||||
|
||||
@event_bus.on(FlowStartedEvent)
|
||||
@crewai_event_bus.on(FlowStartedEvent)
|
||||
def handle_flow_start(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(MethodExecutionStartedEvent)
|
||||
@crewai_event_bus.on(MethodExecutionStartedEvent)
|
||||
def handle_method_start(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(FlowFinishedEvent)
|
||||
@crewai_event_bus.on(FlowFinishedEvent)
|
||||
def handle_flow_end(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@@ -519,19 +519,19 @@ def test_structured_flow_event_emission():
|
||||
|
||||
received_events = []
|
||||
|
||||
@event_bus.on(FlowStartedEvent)
|
||||
@crewai_event_bus.on(FlowStartedEvent)
|
||||
def handle_flow_start(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(MethodExecutionStartedEvent)
|
||||
@crewai_event_bus.on(MethodExecutionStartedEvent)
|
||||
def handle_method_start(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(MethodExecutionFinishedEvent)
|
||||
@crewai_event_bus.on(MethodExecutionFinishedEvent)
|
||||
def handle_method_end(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(FlowFinishedEvent)
|
||||
@crewai_event_bus.on(FlowFinishedEvent)
|
||||
def handle_flow_end(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@@ -585,19 +585,19 @@ def test_stateless_flow_event_emission():
|
||||
flow = StatelessFlow()
|
||||
received_events = []
|
||||
|
||||
@event_bus.on(FlowStartedEvent)
|
||||
@crewai_event_bus.on(FlowStartedEvent)
|
||||
def handle_flow_start(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(MethodExecutionStartedEvent)
|
||||
@crewai_event_bus.on(MethodExecutionStartedEvent)
|
||||
def handle_method_start(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(MethodExecutionFinishedEvent)
|
||||
@crewai_event_bus.on(MethodExecutionFinishedEvent)
|
||||
def handle_method_end(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
@event_bus.on(FlowFinishedEvent)
|
||||
@crewai_event_bus.on(FlowFinishedEvent)
|
||||
def handle_flow_end(source, event):
|
||||
received_events.append(event)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user