Hi, I am looking to have a program flow such that ...
# coroutines
j
Hi, I am looking to have a program flow such that a calling thread starts a coroutine, the coroutine should then suspend itself and return a value to the starting thread. I also would like to pass around the suspended coroutine as a value. The starting thread should then be able to resume the coroutine and also pass a value to the same coroutine. So, kind of like a generator pattern but with the addition of being able to pass values to the coroutine after it is suspended. My basic idea is to use coroutines to seperate a purely functional "business logic" layer and a non-pure imperative layer. I am still starting out so I could easily be missing a basic thing. Could anyone point me in the direction of how to achieve this? From reading the appropriate docs I came up empty so far.