Fibers in Asynchronous Input and Output
You will learn how to use fibers in asynchronous input and output in this lesson.
We'll cover the following...
Simplifying asynchronous input and output tasks
The call stack of a fiber can simplify asynchronous input and output tasks as well. As an example, let’s imagine a system where users sign on to a service by connecting to a server and providing their name, email, and age, in that order. This would be similar to the sign-on user flow of a website. To keep the example simple, instead of implementing an actual web service, let’s simulate user interactions using data entered on the command line. Let’s use the following simple sign-on protocol, where input data is highlighted:
-
hi: A user connects and a flow id is generated.
-
id data: The user of flow that corresponds to id enters the next expected data. For example, if the ...