How would I go about mixing code/statements/functions that I want to run outside the main thread mixed in with code that strickly runs on the main thread.
In mobile world we have tools like rxjava, asynctask, runnables, rxswift and all that good stuff to just drop in lines that run in the background and not bother the fluidness of the main code.
So how to utilize asyncio lib and simply intermingle non blocking code with blocking code?
def mumboJumboCode():
regularStuff = doSomeRegularStuff()
illGetItLater = sendSomeStuffToAWebsocketInTheBackground(regularStuff)
moreRegularStuff = doSomeMoreRegularStuff()
iDontCareWhatItReturns = sendAMessageOverTheWire(illGetItLater)
if (moreRegularStuff => regularStuff):
triggerALambdaSomewhereInTheCloud(moreRegularStuff)