3 ms·
Thank you very much for advice. Yes, I agree empty interfaces{} are a bad way of approaching this. I am thinking of using reflection in order to achieve this.
by richardknop 11y ago
Thank you very much for advice. Yes, I agree empty interfaces{} are a bad way of approaching this.
I am thinking of using reflection in order to achieve this. I will need to think of some clever way to describe the types in the message so I can then use reflection to unpack JSON into proper types and pass them to a task (without making the API too overcomplicated). I will try to do this over next couple of weekends. Hopefully I can come up with some clever and clean API.
Isolating AMQPConnection is also a great idea, I am planning to support multiple brokers (Redis, database etc) in the future.