Minor refactoring

This commit is contained in:
Netkas 2023-06-17 04:25:15 -04:00
parent 129c01b96f
commit eccb072a5e
No known key found for this signature in database
GPG key ID: 5DAF58535614062B

View file

@ -364,25 +364,6 @@
self::addToWatchlist($job_packet->getId()); self::addToWatchlist($job_packet->getId());
} }
/**
* Preforms a do() call on a waitFor() call all in one function.
*
* @param string $function
* @param array $arguments
* @param int $channel
* @param int $timeout
* @return mixed
* @throws JobNotFoundException
* @throws ServerException
* @throws Throwable
* @throws TimeoutException
* @noinspection PhpUnused
*/
public static function doWait(string $function, array $arguments, int $channel=0, int $timeout=0): mixed
{
return self::waitFor(self::do($function, $arguments, $channel), $timeout);
}
/** /**
* Waits for all the dispatched jobs to complete, this is a blocking function and will not return until all the * Waits for all the dispatched jobs to complete, this is a blocking function and will not return until all the
* jobs have completed. If a timeout is specified, the function will return after the timeout has been reached. * jobs have completed. If a timeout is specified, the function will return after the timeout has been reached.
@ -540,6 +521,25 @@
} }
} }
/**
* Preforms a do() call on a waitFor() call all in one function.
*
* @param string $function
* @param array $arguments
* @param int $channel
* @param int $timeout
* @return mixed
* @throws JobNotFoundException
* @throws ServerException
* @throws Throwable
* @throws TimeoutException
* @noinspection PhpUnused
*/
public static function doWait(string $function, array $arguments, int $channel=0, int $timeout=0): mixed
{
return self::waitFor(self::do($function, $arguments, $channel), $timeout);
}
/** /**
* Clears the watchlist, this will remove all jobs from the watchlist. * Clears the watchlist, this will remove all jobs from the watchlist.