mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-03 12:17:48 +08:00
Merge pull request #1288 from limingxinleo/1.1-queue
Added driver object into Hyperf\AsyncQueue\Event\QueueLength event as the first parameter
This commit is contained in:
commit
5f43f74541
@ -112,7 +112,7 @@ abstract class Driver implements DriverInterface
|
||||
{
|
||||
$info = $this->info();
|
||||
foreach ($info as $key => $value) {
|
||||
$this->event && $this->event->dispatch(new QueueLength($key, $value));
|
||||
$this->event && $this->event->dispatch(new QueueLength($this, $key, $value));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,8 +12,15 @@ declare(strict_types=1);
|
||||
|
||||
namespace Hyperf\AsyncQueue\Event;
|
||||
|
||||
use Hyperf\AsyncQueue\Driver\DriverInterface;
|
||||
|
||||
class QueueLength
|
||||
{
|
||||
/**
|
||||
* @var DriverInterface
|
||||
*/
|
||||
public $driver;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
@ -24,8 +31,9 @@ class QueueLength
|
||||
*/
|
||||
public $length;
|
||||
|
||||
public function __construct(string $key, int $length)
|
||||
public function __construct(DriverInterface $driver, string $key, int $length)
|
||||
{
|
||||
$this->driver = $driver;
|
||||
$this->key = $key;
|
||||
$this->length = $length;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user