5

I've a gearman worker (called "manager") which reads a list of urls and then calls, for each of them, another gearman worker (called "dependent") which fetches the content of passed url and does some work on it - indexing, and so on. Each url belongs to the same domain (eg: www.test.com). When every worker calls the curl_init(), a new connection is made to www.test.com.

I'm looking to a method to share the curl's resource handler among workers in order to reuse the same connection. In my case the manager could create the resource handler, then pass it to dependents as a workload parameter.

fdellutri
  • 963
  • 1
  • 7
  • 16

1 Answers1

0

You can use shared memory for store a variable with semaphore functions, http://www.php.net/manual/en/book.sem.php.

Or you can use APC, and dump cached variables into file. But I'am not sure how it will works.

Kirill Zorin
  • 239
  • 1
  • 5