Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added event listeners to make it easy to extend cron jobs and hook in…
… custom behaviors
- Loading branch information
Jared King
committed
Jun 2, 2018
1 parent
02fd1af
commit 6c0856c
Showing
16 changed files
with
327 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Infuse\Cron\Events; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
class CronJobBeginEvent extends Event | ||
{ | ||
const NAME = 'cron_job.begin'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $jobId; | ||
|
||
/** | ||
* @param string $jobId | ||
*/ | ||
public function __construct($jobId) | ||
{ | ||
$this->jobId = $jobId; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getJobId() | ||
{ | ||
return $this->jobId; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Infuse\Cron\Events; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
class CronJobFinishedEvent extends Event | ||
{ | ||
const NAME = 'cron_job.finished'; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $jobId; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $result; | ||
|
||
/** | ||
* @param string $jobId | ||
* @param string $result | ||
*/ | ||
public function __construct($jobId, $result) | ||
{ | ||
$this->jobId = $jobId; | ||
$this->result = $result; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getJobId() | ||
{ | ||
return $this->jobId; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getResult() | ||
{ | ||
return $this->result; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Infuse\Cron\Events; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
class ScheduleRunBeginEvent extends Event | ||
{ | ||
const NAME = 'schedule_run.begin'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
namespace Infuse\Cron\Events; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
|
||
class ScheduleRunFinishedEvent extends Event | ||
{ | ||
const NAME = 'schedule_run.finished'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.