If I understand correctly, this is a framework for non-preemptive cooperative multitasking whereby provided API functions serve as yield points. Pretty much what Windows API was before NT/2000. Not exactly a co-routine library, at least not in a conventional definition of co-routines.
Yes, that's exactly what it is. But it also matches wikipedia's difinition of coroutine: "Coroutines are computer program components that generalize subroutines for nonpreemptive multitasking, by allowing multiple entry points for suspending and resuming execution at certain locations."
Fibers and coroutines are different uses for the same thing. If you schedule your coroutines based on the kernel scheduler, they're fibers. If you jump between fibers explicitly, they're coroutines.
I think it's mainly a fiber library, actually. The TCP and channel functions yield and resume automatically based on when the underlying operation blocks.
They have yield(), but I don't see the opposite, the ability to explicitly resume a stopped context.
Edit: for a "pure" coroutine library, I'd recommend libco from BSNES. It only has 4 functions: active, create, switch and delete. I wrote a fiber library using libco plus libuv, which was fairly easy.
The advantage of deadlines is that you can define a fixed deadline and then re-use it for any number of calls, without having to subtract the time already spent in previous calls.
Yes, and if you set the deadline on the client, the server knows (subject to its time skew) when the request needs to finish. With a timeout, you have to factor in latency, which is necessarily error prone.
... unless, of course, it's on the wall clock scale, in which case changing machine time will invalidate all your deadlines. Just need to be careful to use something like 'ticks from the last boot' rather than UTC time.
In competently run environments, wall clock changes are smeared. :) there is no way to use ticks since last boot, since the server will have a different value from the client.
Kong is a cool product, but Kong spam from a couple of accounts [1] on HN is getting tiresome. (Maybe it's just that I look through the comments of most stories to do with APIs.)