web development in D

Vladimir Panteleev vladimir at thecybershadow.net
Sun May 22 18:55:49 PDT 2011


On Mon, 23 May 2011 03:49:49 +0300, Adam D. Ruppe  
<destructionator at gmail.com> wrote:

> What scared me was that the data comes in on a socket... so wouldn't
> that come with the same threading problems my simple http server
> has? (Where one slow request means everyone else has to wait)

Asynchronous networking is all the rage now. lighttpd is completely  
asynchronous and VERY fast.

Have you heard about NodeJS? It uses asynchronous IO as the primary  
(only?) way to do IO. As closures are first-class JavaScript language  
features, async IO works pretty well there. I dream about creating  
something like this in D as well one day.

Anyway, the idea is that nothing should block your event loop for more  
than a millisecond or so. If something takes longer, then either you need  
to look into "asynchronizing" it (file access?), or putting it in a  
separate, isolated thread.

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d-learn mailing list