<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process(self, input_data, topic=None):
 """ Invokes each handler in sequence. Publishes final output data. Params: input_data: message received by stream topic: name of plugin or stream message received from, if applicable """

        for handler in self.handlers:
            output = handler.handle(input_data)
            input_data = output

        self.publish(input_data)