shaneharter / PHP-Daemon

Build production-ready Daemons using PHP 5.3+. Build fault-tolerant applications without the boilerplate.
Other
768 stars 166 forks source link

Unit tests for Core_IWorkerVia #47

Open brunnels opened 10 years ago

brunnels commented 10 years ago

I would like to start work on adding a Core_Worker_Via_Memcache class. It would make it much simpler to implement this new class if there were some unit tests to run to ensure the results from each method call are behaving as intended.

shaneharter commented 10 years ago

I agree. That's been the plan but as you can tell, I have limited time to work in this. Where I currently work we don't use the library, I left the job I was at when I wrote it. So this is all in my own time alongside other side projects/etc.

After I added the Workers functionality, the otherwise simple daemon library got a lot more complicated. So I planned 3 releases:

  1. Refactor and clean-up the original Mediator logic, which used to have hard dependencies on shm and mq. Extract the IPC and add an interface. That shipped last year.
  2. Add unit test coverage including refactoring to use DI where necessary to assist testing.
  3. Add more Via objects and other functionality.

Had I started writing this library today I certainly would've included test coverage from day 1. I wasn't there yet in 2010 when I started it.

On Mon, May 5, 2014 at 7:57 AM, Benjamin Runnels notifications@github.comwrote:

I would like to start work on adding a Core_Worker_Via_Memcache class. It would make it much simpler to implement this new class if there were some unit tests to run to ensure the results from each method call are behaving as intended.

— Reply to this email directly or view it on GitHubhttps://github.com/shaneharter/PHP-Daemon/issues/47 .

brunnels commented 10 years ago

From first glance looks like I can re-use a lot of the code from Core_Lock_Memcached

brunnels commented 10 years ago

Ohh, don't want to use memcached but memcache. Will see what I can work out.

shaneharter commented 10 years ago

Any reason why?

In my experience with this Memcached was more reliable than Memcache -- both are just client libraries.

I've moved to redis some time ago for most of my work so this may have changed.

Shane

On Mon, May 5, 2014 at 12:32 PM, Benjamin Runnels notifications@github.comwrote:

Ohh, don't want to use memcached but memcache. Will see what I can work out.

— Reply to this email directly or view it on GitHubhttps://github.com/shaneharter/PHP-Daemon/issues/47#issuecomment-42228430 .

brunnels commented 10 years ago

I have memcache installed already. lol

shaneharter commented 10 years ago

well for the most part they should be drop-in replacements.

in prod, unless things have changed since I last investigated this, I'd certainly go w/ memcached

On Mon, May 5, 2014 at 1:23 PM, Benjamin Runnels notifications@github.comwrote:

I have memcache installed already. lol

— Reply to this email directly or view it on GitHubhttps://github.com/shaneharter/PHP-Daemon/issues/47#issuecomment-42234589 .