Does cowboy use process pool to process http/websocket/loop handlers?
It has an acceptor pool to accept connections and a connection pool for running connections. But the processes themselves are entirely independent.
I logged self() in init and terminate handler and see the second request has the same pid() as the first request. As I can understand if I start timer in init() I should cancel it in terminate handler. Right?
This can happen when requests are sent over the same connection with keep-alive.
I probably should explain that in the documentation.
It should be good to have right example of long polling in documentation with cancellation of timer.
I'll leave this open to check everything out on this.
One more question. If exception is occurred in loop handler does it mean that a process will be terminated or it will live for reuse (in keep-alive case).
If any unexpected error happens it is terminated.
Put myself a note in the guide draft, to explain these things.