nradulovic / pyeds

Python Event Driven System
GNU Lesser General Public License v3.0
11 stars 4 forks source link

RuntimeError: 'State exception', '__main__', #43

Closed pivodog closed 8 months ago

pivodog commented 2 years ago

I am getting run time errors when creating a state machine inside of main but I don't when the state machines are created outside of main? How do you handle this issue?

broken example:

create state machines

master = Master()

slave = Slave()

def main():

create state machines

master = Master()
slave = Slave()

master.do_start()

master.wait()

good example:

create state machines

master = Master() slave = Slave()

def main():

create state machines

#master = Master()
#slave = Slave()

master.do_start()

master.wait()