# Path: pypipeline/core/Destination.py
# class Destination:
#     def __init__(self, plumber, params):
#         self.plumber = plumber
#         self.params = params
# 
#     def process(self, exchange):
#         raise NotImplementedError("Subclass of destination needs to implement process method")
# 
# Path: pypipeline/core/Processor.py
# class Processor:
#     def __init__(self, obj):
#         self.object = obj
#         self.next = None
# 
#     def process(self, exchange):
#         try:
#             self._process(exchange)
#         except Exception as e:
#             raise e
# 
#     def _process(self, exchange):
#         self.object.process(exchange)
#         if self.next is not None:
#             self.next.process(exchange)
# 
# Path: pypipeline/core/Property.py
# class Property(Enum):
#     slip_endpoint = 1


from pypipeline.core.Destination import Destination
from pypipeline.core.Processor import Processor
from pypipeline.core.Property import Property


class RoutingSlipProcessor(Processor):
    def __init__(self, routing_slip):
        super().__init__(None)
        self.routing_slip = routing_slip

    def _process(self, exchange):
        endpoints = self.routing_slip.slip(exchange)

# Path: pypipeline/core/Destination.py
# class Destination:
#     def __init__(self, plumber, params):
#         self.plumber = plumber
#         self.params = params
# 
#     def process(self, exchange):
#         raise NotImplementedError("Subclass of destination needs to implement process method")
# 
# Path: pypipeline/core/Processor.py
# class Processor:
#     def __init__(self, obj):
#         self.object = obj
#         self.next = None
# 
#     def process(self, exchange):
#         try:
#             self._process(exchange)
#         except Exception as e:
#             raise e
# 
#     def _process(self, exchange):
#         self.object.process(exchange)
#         if self.next is not None:
#             self.next.process(exchange)
# 
# Path: pypipeline/core/Property.py
# class Property(Enum):
#     slip_endpoint = 1


# Path: pypipeline/eip/routing_slip/RoutingSlipProcessor.py
from pypipeline.core.Destination import Destination
from pypipeline.core.Processor import Processor
from pypipeline.core.Property import Property



class RoutingSlipProcessor(Processor):
    def __init__(self, routing_slip):
        super().__init__(None)
        self.routing_slip = routing_slip

    def _process(self, exchange):
        endpoints = self.routing_slip.slip(exchange)

        for destination_class, params in endpoints: