prooph/service-bus

Query bus plugins cannot add to the chain.

bweston92 opened this issue · 1 comments

Consider the following:

// It currently does this.
$deferred = new Deferred();
$promise = $deferred->promise();

$promise->then(function ($a) {
  return strtoupper($a);
});

$promise->done(function ($a) {
  // $a = 'hey;
});

$deferred->resolve('a');

// We need to do this.
$deferred = new Deferred();
$promise = $deferred->promise();

$promise->then(function ($a) {
  return strtoupper($a);
})->done(function ($a) {
  // $a = 'HEY;
});

$deferred->resolve('a');

We need to set the promise on the action event and then allow plugins to add to the chain updating the action events promise with the last chain and return that.

Fixed with #98