|
|
|
|
|
by pron
4046 days ago
|
|
> This is because it's not the asynchronicity that bites you But it's certainly what makes your code much harder to read and write (certainly when not using Scala), and it is exactly what colors your code in red and blue. > This really means that your pieces of I/O logic are still separated into blocking and non-blocking (red versus blue) But they're not. You can use the same wrapped JDBC data source, or the same lock in your threads and your fibers. There is no more "non-blocking", so it really does uncolor your code -- all code can run in a fiber or a thread. You can take the very same code and run it in a thread -- in which case a kernel thread will be blocked -- or a fiber -- in which case the fiber will be blocked -- and the only difference will be how many of those threads/fibers (Quasar calls them both "strands") you can have, which is exactly a heavyweight/lightweight choice. |
|