brianlmoon/GearmanManager — Issue #37: Creating resources/objects in a worker that stay alive from job to job
Author: Bartzy
Created: 2012-02-02 17:14:01+00:00
State: open

Hi,

How can I create resources or objects (for example a DB connection) that stay alive from job to job? If the PHP workers are always running, it seems silly to 'include db.php' in the worker function every time (which creates a DB handle).

Can it be done outside of the worker function?

Thanks,
Bar.