Skip to content

Commit f363374

Browse files
committed
Merge branch 'master' into 0.8
2 parents c33bd70 + a3b7c51 commit f363374

File tree

3 files changed

+46
-22
lines changed

3 files changed

+46
-22
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Change Log
22

3+
## [0.7.19](https://github.com/php-enqueue/enqueue-dev/tree/0.7.19) (2017-10-13)
4+
[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.7.18...0.7.19)
5+
6+
- Amqp basic consume fixes [\#223](https://github.com/php-enqueue/enqueue-dev/pull/223) ([makasim](https://github.com/makasim))
7+
- Adds to small extension points to JobProcessor [\#222](https://github.com/php-enqueue/enqueue-dev/pull/222) ([iainmckay](https://github.com/iainmckay))
8+
- \[BC break\]\[amqp\] Use same qos options across all all AMQP transports [\#221](https://github.com/php-enqueue/enqueue-dev/pull/221) ([makasim](https://github.com/makasim))
9+
- \[BC break\] Amqp add basic consume support [\#217](https://github.com/php-enqueue/enqueue-dev/pull/217) ([makasim](https://github.com/makasim))
10+
11+
- Amqp basic consume fixes [\#223](https://github.com/php-enqueue/enqueue-dev/pull/223) ([makasim](https://github.com/makasim))
12+
13+
- Fix typo [\#227](https://github.com/php-enqueue/enqueue-dev/pull/227) ([f3ath](https://github.com/f3ath))
14+
315
## [0.7.18](https://github.com/php-enqueue/enqueue-dev/tree/0.7.18) (2017-10-10)
416
[Full Changelog](https://github.com/php-enqueue/enqueue-dev/compare/0.7.17...0.7.18)
517

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is where all development happens. The repository provides a friendly enviro
88
Features:
99

1010
* [Feature rich](docs/quick_tour.md).
11-
* Implements [JMS](https://docs.oracle.com/javaee/7/api/javax/jms/package-summary.html) like transports based on a[queue-interop](https://github.com/queue-interop/queue-interop) interfaces.
11+
* Implements [JMS](https://docs.oracle.com/javaee/7/api/javax/jms/package-summary.html) like transports based on [queue-interop](https://github.com/queue-interop/queue-interop) interfaces.
1212
* Supported transports
1313
* Amqp based on [the ext](docs/transport/amqp.md), [bunny](docs/transport/amqp_bunny.md), [the lib](docs/transport/amqp_lib.md)
1414
* [Beanstalk](docs/transport/pheanstalk.md)

pkg/job-queue/JobProcessor.php

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function findOrCreateRootJob($ownerId, $jobName, $unique = false)
6363
$job->setUnique((bool) $unique);
6464

6565
try {
66-
$this->jobStorage->saveJob($job);
66+
$this->saveJob($job);
6767

6868
return $job;
6969
} catch (DuplicateJobException $e) {
@@ -97,11 +97,9 @@ public function findOrCreateChildJob($jobName, Job $rootJob)
9797
$job->setCreatedAt(new \DateTime());
9898
$job->setRootJob($rootJob);
9999

100-
$this->jobStorage->saveJob($job);
100+
$this->saveJob($job);
101101

102-
$this->producer->sendEvent(Topics::CALCULATE_ROOT_JOB_STATUS, [
103-
'jobId' => $job->getId(),
104-
]);
102+
$this->sendCalculateRootJobStatusEvent($job);
105103

106104
return $job;
107105
}
@@ -128,11 +126,9 @@ public function startChildJob(Job $job)
128126
$job->setStatus(Job::STATUS_RUNNING);
129127
$job->setStartedAt(new \DateTime());
130128

131-
$this->jobStorage->saveJob($job);
129+
$this->saveJob($job);
132130

133-
$this->producer->sendEvent(Topics::CALCULATE_ROOT_JOB_STATUS, [
134-
'jobId' => $job->getId(),
135-
]);
131+
$this->sendCalculateRootJobStatusEvent($job);
136132
}
137133

138134
/**
@@ -157,11 +153,9 @@ public function successChildJob(Job $job)
157153
$job->setStatus(Job::STATUS_SUCCESS);
158154
$job->setStoppedAt(new \DateTime());
159155

160-
$this->jobStorage->saveJob($job);
156+
$this->saveJob($job);
161157

162-
$this->producer->sendEvent(Topics::CALCULATE_ROOT_JOB_STATUS, [
163-
'jobId' => $job->getId(),
164-
]);
158+
$this->sendCalculateRootJobStatusEvent($job);
165159
}
166160

167161
/**
@@ -186,11 +180,9 @@ public function failChildJob(Job $job)
186180
$job->setStatus(Job::STATUS_FAILED);
187181
$job->setStoppedAt(new \DateTime());
188182

189-
$this->jobStorage->saveJob($job);
183+
$this->saveJob($job);
190184

191-
$this->producer->sendEvent(Topics::CALCULATE_ROOT_JOB_STATUS, [
192-
'jobId' => $job->getId(),
193-
]);
185+
$this->sendCalculateRootJobStatusEvent($job);
194186
}
195187

196188
/**
@@ -219,11 +211,9 @@ public function cancelChildJob(Job $job)
219211
$job->setStartedAt($stoppedAt);
220212
}
221213

222-
$this->jobStorage->saveJob($job);
214+
$this->saveJob($job);
223215

224-
$this->producer->sendEvent(Topics::CALCULATE_ROOT_JOB_STATUS, [
225-
'jobId' => $job->getId(),
226-
]);
216+
$this->sendCalculateRootJobStatusEvent($job);
227217
}
228218

229219
/**
@@ -252,4 +242,26 @@ public function interruptRootJob(Job $job, $force = false)
252242
}
253243
});
254244
}
245+
246+
/**
247+
* @link https://github.com/php-enqueue/enqueue-dev/pull/222#issuecomment-336102749 See for rationale
248+
*
249+
* @param Job $job
250+
*/
251+
protected function saveJob(Job $job)
252+
{
253+
$this->jobStorage->saveJob($job);
254+
}
255+
256+
/**
257+
* @link https://github.com/php-enqueue/enqueue-dev/pull/222#issuecomment-336102749 See for rationale
258+
*
259+
* @param Job $job
260+
*/
261+
protected function sendCalculateRootJobStatusEvent(Job $job)
262+
{
263+
$this->producer->sendEvent(Topics::CALCULATE_ROOT_JOB_STATUS, [
264+
'jobId' => $job->getId(),
265+
]);
266+
}
255267
}

0 commit comments

Comments
 (0)