are there any solutions for resumable coroutines t...
# coroutines
a
are there any solutions for resumable coroutines that persist over application restarts? I saw this from nextjs yesterday and I would love to have something like this* on my backend *this = having coroutines run and not having to worry about server restarts (ie have
delay()
for some days and then continue the coroutine)
PS: I don't mind getting my hands dirty and hack a way to do this. My usecase is very simple and i would imagine that a 'proper' way to do this would be complex to build. Haven't looked into this yet and I would love some pointers towards how to (maybe) plug into the way coroutines work to persist their continuation.
h
While I do agree that idea is nice, imho a workflow engine is out of scope of coroutines. How do you want to store the data? How do you want to run the steps, in a distributed system with different workers? The code already uses implicit calls like
use workflow
and
use step
. These functions should be part of a fault tolerant engine using a persistent database.
1
a
i had a look at 'workflows' (didnt know the concept). there seem to be a few solutions already for this, but not kotlin/coroutines specific. i think i can use some javascript solution from kotlin tho