Minor refactoring
This commit is contained in:
parent
129c01b96f
commit
eccb072a5e
1 changed files with 19 additions and 19 deletions
|
@ -364,25 +364,6 @@
|
|||
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
|
||||
* 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.
|
||||
|
|
Loading…
Add table
Reference in a new issue