Mod_ruby and multiple requests

Hello,

Does each instance of mod_ruby (or apache) handle only one request at a
time?

The reason I’m asking is because I’d like to set a global variable (I know,
I know…) at the very beginning of the script and nil it at the end (rather
than passing it around from method to method or object to object), but I
don’t know if this will cause problems or not.

Thanks,

Chris

There is no guarantee that the second page you call will be handled by the
same instance, but within a single script the scope won’t change out from
under you. The global value you set will be available the next time a
request gets handled by that instance, though, so be sure you are setting
it before you read it.

Are you sure you need a global variable ($variable)? If it is within the
script there should be no need for a true global; a regular top-level
variable should serve.

–Gabriel

···

On Thu, 20 Feb 2003 04:19:04 +0900, Chris Pine wrote:

Hello,

Does each instance of mod_ruby (or apache) handle only one request at a
time?

The reason I’m asking is because I’d like to set a global variable (I know,
I know…) at the very beginning of the script and nil it at the end (rather
than passing it around from method to method or object to object), but I
don’t know if this will cause problems or not.

Thanks,

Chris