diff --git a/components/i_feed/requirements.txt b/components/i_feed/requirements.txt new file mode 100644 index 0000000..29a1d83 --- /dev/null +++ b/components/i_feed/requirements.txt @@ -0,0 +1,2 @@ +circuitbreaker # fault tolerance + diff --git a/components/i_feed/traffic_light.py b/components/i_feed/traffic_light.py index 4640904..a0efe5c 100644 --- a/components/i_feed/traffic_light.py +++ b/components/i_feed/traffic_light.py @@ -1 +1,6 @@ -# TODO +from circuitbreaker import circuit + + +@circuit(failure_threshold=10, expected_exception=ConnectionError) +def external_call(): + ... diff --git a/components/i_feed/vehicle.py b/components/i_feed/vehicle.py index 4640904..a0efe5c 100644 --- a/components/i_feed/vehicle.py +++ b/components/i_feed/vehicle.py @@ -1 +1,6 @@ -# TODO +from circuitbreaker import circuit + + +@circuit(failure_threshold=10, expected_exception=ConnectionError) +def external_call(): + ...