From: Matt S Trout Date: Wed, 19 Feb 2014 21:07:37 +0000 (+0000) Subject: allow observer to enter N facts X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f6927d1c8d44ae629ed7aa67552162e3812eabcb;p=scpubgit%2FDKit.git allow observer to enter N facts --- diff --git a/lib/DX/ResultStream.pm b/lib/DX/ResultStream.pm index 5816b03..559c1f1 100644 --- a/lib/DX/ResultStream.pm +++ b/lib/DX/ResultStream.pm @@ -25,9 +25,11 @@ sub next { last if $state->isa('DX::State'); if ($state->isa('DX::ObservationRequired')) { if ($self->observation_policy->($state->observer)) { - my ($type, $value) = $state->observer->run; + my @ob = $state->observer->run; $state = $state->resume; - $state->facts->{$type}->set_value($value); + while (my ($type, $value) = splice(@ob, 0, 2)) { + $state->facts->{$type}->set_value($value); + } } else { die "Observation refused"; }