|
|
|
|
|
by ketralnis
3852 days ago
|
|
Erlang is sort of this. All I/O is done by passing messages to Port objects which send the results/errors back as messages. Your process doesn't block until you tell it to and you don't block on a single operation exactly: you block on waiting for a message in your process's mailbox. The nice thing about this approach is that you can emulate blocking or non-blocking I/O within the same function or even against the same file descriptor. And processes are so cheap that if your callees do block in unexpected ways you can just move that one call into its own process that just sends you a message when it's done. |
|