|
|
|
|
|
by hnav
980 days ago
|
|
I feel like once serializing god-knows-what state across program invocations is a requirement, I'd much prefer writing this explicitly so I can at least have a chance of debugging it type Task struct {
I int
}
func (t *Task) Next() (bool, int) {
if t.I < 3 {
return t.I++, true
}
return 0, false
}
var t Task
t.Next()
json.Marshal(t)
|
|
What if there were tools to inspect and debug the coroutine state? That's an area we're exploring now.