package
module
Version:
v0.0.0-...-a35ac31
Opens a new window with list of versions in this module.
Published: Jul 26, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
co
coroutine library
A coroutine library to implement deterministic scheduling of concurrent processes.
Mostly inspired by Rob Pike's recursive state function type in his Lexical Scanning in Go talk.
I use this pattern a lot in the sb library, modeling stream/sink process as recursive functions.
Roadmap
- I/O waiting. channel polling
- threaded scheduler
- prioritized scheduling
Documentation
¶
type Proc[V any] func(next *Proc[V]) V
Proc represents a procedure that returns a value and sets the next procedure
type Thread[S any, V any] struct {
}
Thread represents a state and a procedure
NewThread creates a new thread
Step execute the thread in single step
Source Files
¶
Click to show internal directories.
Click to hide internal directories.