MOO-cows Mailing List Archive


Re: on-the-fly guest creation

< Hope this helps.  We use this method to handle web connections to our moo,
< except instead of making children of $guest, we make children of the new 
< player class $web_user (and instead of connect, the verb to login is

Ouch, I personally wouldn't suggest this.  There is a bit of overhead
involved in creating an object, and you do not want an HTTP daemon to be
slow (it is easilly noticeable).  I would suggest keeping a cache around
of http objects which are nearly initialized.  Upon connect you set
whatever parameters are needed, do whatever.  Upon disconnect you reset
the values to defaults.  Then grow/reduce the cache as is necessary.

Even web daemons (NCSA, Apache) are moving to this cache design, rather
than forking off new processes for each connection.  In the long run, the
overhead of initializing a new object for each connection isn't worth the
return, and can be even more messy.

-Brandon Gillespie/Lynx-

Follow-Ups: References:

Home | Subject Index | Thread Index