Eight Ways to Handle Non-Blocking Returns in Message-Passing Programs – with Script

TBH, I am a big fan of actor- and reactor-like programming patterns (also known as Finite State Machines. While you’re not strictly required to use reactors and might be able to get away without them – they DO provide several very substantial benefits.