On Thu, 1 Sep 2016 14:32:55 -0700
Amelia Ireland <[email protected]> wrote:

> Do instances of a Dancer app stay around between requests, or is the
> app created when a request comes in, it does its stuff, and then it is
> destroyed? What happens to variables set with the 'var' keyword: will
> they persist on a dancer app between requests?

The worker processes persist until reloaded.  Any global variables
(package globals or file-level "my" or "our" variables) will persist.
I take advantage of this in my webapps to pre-load names and other
commonly-used and rarely changing stuff at startup to reduce database
lookups in requests.

To refresh your variables, you could HUP the starman master with this
command:

$ kill -HUP $(pgrep starman.master)

I'm *pretty sure* variables with "var" are not persistent, but are
only stored through the life cycle of a single request.

-- 

C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0

_______________________________________________
dancer-users mailing list
[email protected]
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to