【发布时间】:2011-06-13 13:28:36
【问题描述】:
我为并行任务编写了一个基于 Zend Framework 的 cron 服务,ran into issues with the child threads sharing resources with the parent。我解决了database connection issue,但我现在看到Zend_Db_Table_Abstract 无法将表元数据保存到元数据缓存的周期性问题。
将元数据保存到 metadataCache 失败
我在引导期间初始化元数据缓存。与其从引导程序复制我的代码并在分叉后执行,我认为使用$application->bootstrap('[...]') 调用Bootstrap->_init[...] 函数可能会更好。
更新
因为Zend_Controller_Front::getInstance() 是一个单例,使用它来获取引导实例并以这种方式调用函数会使我回到我已经解决的共享资源的相同问题。
我想以某种方式保持这个 DRY,同时避免分叉后共享资源的问题。
【问题讨论】:
标签: php zend-framework zend-application zend-app-bootstrap