File tree Expand file tree Collapse file tree 3 files changed +34
-21
lines changed Expand file tree Collapse file tree 3 files changed +34
-21
lines changed Original file line number Diff line number Diff line change 55class JobQueued
66{
77 /**
8+ * The connection name.
9+ *
10+ * @var string
11+ */
12+ public $ connectionName ;
13+
14+ /**
15+ * The job ID.
16+ *
817 * @var string|int|null
918 */
10- public $ jobId ;
19+ public $ id ;
1120
1221 /**
13- * @var string|object
22+ * The job instance.
23+ *
24+ * @var \Closure|string|object
1425 */
1526 public $ job ;
1627
1728 /**
18- * JobQueued constructor .
29+ * Create a new event instance .
1930 *
20- * @param string|int|null $jobId
31+ * @param string $connectionName
32+ * @param string|int|null $id
2133 * @param \Closure|string|object $job
2234 * @return void
2335 */
24- public function __construct ($ jobId , $ job )
36+ public function __construct ($ connectionName , $ id , $ job )
2537 {
26- $ this ->jobId = $ jobId ;
38+ $ this ->connectionName = $ connectionName ;
39+ $ this ->id = $ id ;
2740 $ this ->job = $ job ;
2841 }
2942}
Original file line number Diff line number Diff line change @@ -317,6 +317,20 @@ protected function shouldDispatchAfterCommit($job)
317317 return false ;
318318 }
319319
320+ /**
321+ * Raise the job queued event.
322+ *
323+ * @param string|int|null $jobId
324+ * @param \Closure|string|object $job
325+ * @return void
326+ */
327+ protected function raiseJobQueuedEvent ($ jobId , $ job )
328+ {
329+ if ($ this ->container ->bound ('events ' )) {
330+ $ this ->container ['events ' ]->dispatch (new JobQueued ($ this ->connectionName , $ jobId , $ job ));
331+ }
332+ }
333+
320334 /**
321335 * Get the connection name for the queue.
322336 *
@@ -350,18 +364,4 @@ public function setContainer(Container $container)
350364 {
351365 $ this ->container = $ container ;
352366 }
353-
354- /**
355- * Raise the job queued event.
356- *
357- * @param string|int|null $jobId
358- * @param \Closure|string|object $job
359- * @return void
360- */
361- protected function raiseJobQueuedEvent ($ jobId , $ job )
362- {
363- if ($ this ->container ->bound ('events ' )) {
364- $ this ->container ['events ' ]->dispatch (new JobQueued ($ jobId , $ job ));
365- }
366- }
367367}
Original file line number Diff line number Diff line change @@ -477,7 +477,7 @@ public function testPushJobQueuedEvent($driver)
477477 $ events = m::mock (Dispatcher::class);
478478 $ events ->shouldReceive ('dispatch ' )->withArgs (function (JobQueued $ jobQueued ) {
479479 $ this ->assertInstanceOf (RedisQueueIntegrationTestJob::class, $ jobQueued ->job );
480- $ this ->assertIsString (RedisQueueIntegrationTestJob::class, $ jobQueued ->jobId );
480+ $ this ->assertIsString (RedisQueueIntegrationTestJob::class, $ jobQueued ->id );
481481
482482 return true ;
483483 })->andReturnNull ()->once ();
You can’t perform that action at this time.
0 commit comments