On Mon, Apr 8, 2019 at 1:09 AM Peter Bex <xxxxxx@more-magic.net> wrote:
  
I mean if the dispatch table is a global, all threads would share it.

Yes, but that's fine.  It's protected by a mutex.  If that were to become a bottleneck, there are better implementations I could use, but since changes are rare, that hasn't been a problem.
  
In Spiffy, you can parameterize (or mutate, but that's not recommended)
some settings around the call to the "continue" procedure.  So, a handler
does not need to actually send a response *or* call the continue
procedure; it can do things.

That sounds great.
 
> | That means the port you pass to the writer needs to know if it should
> | "auto-chunk" or just pass on the data as-is.
>
> The port can buffer enough data to decide whether to chunk, then either pass
> the buffered data straight through or chunk it and everything that follows.

Okay, should work.