ghubstan cffbfcf481
Split API examples & doc generator into separate modules
This might give Python devs an easier time than if all the sample
code lived deep inside a gradle project.  This means there is
no root project gradle build file;  the reference-doc-builder and
java-examples modules are separate java projects, with their own
build files.
2022-03-16 17:21:25 -03:00

23 lines
634 B
Python

# From https://expobrain.net/2010/07/31/simple-event-dispatcher-in-python
from trade_event import TradeEvent
from trade_event_data import TradeEventData
class TradeEventSender(object):
"""
First class which ask who is listening to it
"""
def __init__(self, event_dispatcher):
# Save a reference to the event dispatch
self.event_dispatcher = event_dispatcher
def main(self):
"""
Send a TradeEvent
"""
self.event_dispatcher.dispatch_event(
TradeEvent(TradeEvent.MUST_SEND_PAYMENT_STARTED_MSG_EVENT, TradeEventData('trade', 'what to do...'))
)