Capy’s Programming Model
Capy is a framework for dealing with I/O, that is any data that is communicated between a running program and the outside environment: network, file-system, system timers and other events.
This data arrives or is consumed asynchronously: at points in time unpredictable to the program.
The goal of the framework is to utilize system resources to be able to:
-
process as many such asynchronous events as possible,
-
process them as fast as possible,
-
have the user code maximally simple and maintainable.
In order to achieve this Capy employs event-driven flows expressed as coroutines. This section will introduce you to these concepts.