I have a number of different services that each publish events, and then one service which subscribes to all of them and does the same/similar things with each.
I was wondering if instead of:
@event_handler("source1", "event_type1") def do_something1(payload): #do thing @event_handler("source1", "event_type2") def do_something2(payload): #do thing #do another thing @event_handler("source2", "event_type3") def do_something3(payload): #do thing
I could instead do something like:
@event_handler(source, event_type) def do_something(payload): #do a thing #if event_type == "eventy_type3": #do another thing