First experimental release
Welcome to the first release of gears, the experimental cross-platform asynchronous programming library for Scala 3!
In this first release, we introduce concepts of asynchronous programming, both low-level/unstructured (sources, listeners, channels) and concepts for high-level structured concurrency. These are the first iteration of a complete design, and might have some holes in usability and performance. Feedback is appreciated!
A tutorial about the basic concepts will be available soon.
What is included?
User-facing, high level asynchronous programming
gears.asyncintroduces the concept of anAsynccontext/capability: functions that implicitly take anAsynccontext (using Async) are suspendable computations and are capable of both performing asynchronous operations and spawning more concurrent asynchronous computations. This is the recommended way to write asynchronous code: Functions that explicitly need to suspend or spawn concurrent computations should take anAsynccontext:
However, higher-order functions that do not explicitly use these capabilities do have to take an context.def performAsyncIO(using Async): Int = ???