This commit is contained in:
2021-03-08 11:44:16 +08:00
parent 7fa3d3b6a4
commit 250db97299
+27
View File
@@ -382,6 +382,33 @@ class Snowflake
}
/**
* @return bool
*/
public static function isTask(): bool
{
return static::getEnvironmental() == static::TASK;
}
/**
* @return bool
*/
public static function isWorker(): bool
{
return static::getEnvironmental() == static::WORKER;
}
/**
* @return bool
*/
public static function isProcess(): bool
{
return static::getEnvironmental() == static::PROCESS;
}
/**
* @param $class
* @param $file