| Conditions | 1 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import importlib |
||
| 4 | def load_reader(name, host, port, group, topic): |
||
| 5 | """ |
||
| 6 | Creates an instance of the given reader. |
||
| 7 | An reader consumes messages from Kafka. |
||
| 8 | """ |
||
| 9 | reader_module = importlib.import_module(name) |
||
| 10 | reader_class = getattr(reader_module, "Reader") |
||
| 11 | # Return an instance of the class |
||
| 12 | return reader_class(host, port, group, topic) |
||
| 13 |