Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
41 | public function handle($message, callable $next) |
||
42 | { |
||
43 | $this->queue[] = Delegate::fromClosure(function () use ($message, $next) { |
||
44 | return $next($message); |
||
45 | }); |
||
46 | |||
47 | if ($this->isRunning) { |
||
48 | return; |
||
49 | } |
||
50 | |||
51 | $this->isRunning = true; |
||
52 | try { |
||
53 | $this->runQueuedJobs(); |
||
54 | } catch (\Exception $e) { |
||
55 | $this->isRunning = false; |
||
56 | $this->queue = []; |
||
57 | |||
58 | throw $e; |
||
59 | } |
||
60 | |||
61 | $this->isRunning = false; |
||
62 | } |
||
63 | |||
74 |