HPInc / HP-Digital-Microfluidics

HP Digital Microfluidics Software Platform and Libraries
MIT License
2 stars 0 forks source link

should run_protocol keep running in case there is no session id? #192

Closed EvanKirshenbaum closed 5 months ago

EvanKirshenbaum commented 5 months ago

should the program keep running if a session id was not established here

seems like the next line would throw an error without the data key?

Migrated from internal repository. Originally created by Mark Huber on Aug 10, 2022 at 10:37 AM PDT. Closed on Aug 10, 2022 at 11:22 AM PDT.
EvanKirshenbaum commented 5 months ago

I'd say that the program should certainly keep running (since it may have a fallback for the pipettor to use or it may want to display the situation in some specific manner or the program might not actually try to use the pipettor), but run_protocol() should certainly stop, probably after setting some indication that can be checked when the program tries to use the pipettor.

Note that we can't just raise an exception, since run_protocol() is called within ProtocolManager.run(), and ProtocolManager is a Thread that's start()ed from within OT2.join_system(), so it's asynchronous with the main setup thread.

My best guess at this point is that OT2.perform() should check some property of its manager and raise an exception if it knows it's not going to work. Note that there's a possible race condition, so the property will probably want to be a Delayed future that perform() can wait on.

Migrated from internal repository. Originally created by @EvanKirshenbaum on Aug 10, 2022 at 10:59 AM PDT.
EvanKirshenbaum commented 5 months ago

ohh kk

Migrated from internal repository. Originally created by Mark Huber on Aug 10, 2022 at 11:22 AM PDT.