MendelGusmao/PHP-Ghetto-IPC — Issue #5: Passing closures to back end aka 'direct back end coding'
Author: MendelGusmao
Created: 2011-11-04 10:02:11+00:00
State: open

@ front end (PHP >= 5.3):

$call = new ClosureCall(
function ($a, $b) { return $a + $b; },
array(1, 2),
"var_dump"
);

// Note: no back end specified!
$ipc = new GhettoIPC(new FileDriver, null, $call);

*A Closure object doesn't provide __toString and can't be serialized*

Even if at some point of PHP development it is implemented, here are some issues:

How to execute the back end without a file as back end?
How to instantiate and execute GhettoIPC in back end?
GhettoIPC would detect the existence of ClosureCalls in the queue and add a piece of code to do it? (ugly: using '-r').
If positive, what if there are any Call/StaticCall/ObjectCall objects in the queue? Can they depend on a ClosureCall by letting it create the callees?
What about the 'use' construct? It's supposed to get values from back end or front end?
(...)

;)