jikan-rest/app/Events/SourceHeartbeatEvent.php

32 lines
650 B
PHP
Raw Normal View History

<?php
namespace App\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Storage;
/**
2020-09-13 12:52:15 +05:00
* Class SourceHeartbeatEvent
* @package App\Events
*/
2020-09-13 12:52:15 +05:00
class SourceHeartbeatEvent extends Event
{
public const BAD_HEALTH = 1;
public const GOOD_HEALTH = 0;
2022-02-18 05:13:23 +05:00
public int $health;
public int $status;
/**
2020-09-13 12:52:15 +05:00
* SourceHeartbeatEvent constructor.
2022-02-18 05:13:23 +05:00
* @param int|null $health
* @param int|null $status
*/
2021-12-28 00:36:12 +05:00
public function __construct(?int $health, ?int $status)
{
2021-12-28 00:36:12 +05:00
$this->health = $health ?? self::BAD_HEALTH;
$this->status = $status ?? 0;
}
}