PHP7 Builder

This commit is contained in:
Dominik Liebler
2016-09-22 13:51:35 +02:00
parent 9f42521e8f
commit 7beb1420b4
3 changed files with 3 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
<?php
namespace DesignPatterns\Creational\Pool;
class Worker
{
public function __construct()
{
// let's say that constuctor does really expensive work...
// for example creates "thread"
}
public function run($image, array $callback)
{
// do something with $image...
// and when it's done, execute callback
call_user_func($callback, $this);
}
}