-
2.1.0 Stable
released this
2023-07-07 04:31:51 +00:00 | 10 commits to master since this releaseAdded
- Implemented
ausleep()
in forTamerLib\Classes\ > JobManager
to allow TamerLib to monitor sub-processes and
workers without blocking the main thread. - Updated some methods in
TamerLib\Classes\ > JobManager
to use properties fromJobPacket
instead of calling
the server for the same information if the passed parameter (usually $job_id) is an instance ofJobPacket
,
this reduces the number of calls to the server and improves performance. - Updated some methods in
TamerLib > tm
to useasleep
instead ofsleep
to allow TamerLib to monitor sub-processes
and workers without blocking the main thread. - Added a custom redis configuration file to improve performance when running TamerLib on a single machine.
Changed
\TamerLib\Classes\ > RedisServer > start()
now starts the server with a matching logging level tonet.nosial.loglib
- Changed method
public static function do(string $function, array $arguments=[], int $channel=0): int
topublic static function do(string $function, array $arguments=[], ?callable $callback=null, array $options=[]): int
in\TamerLib > tm > do()
so that the$callback
parameter is now optional and will be used to handle the result of the job whentm::wait()
is called, additionally some options can be passed to the job such aschannel
for passing on the channel to the
function as previously done with the$channel
parameter. - Changed method
public static function dof(string $function, array $arguments=[], int $channel=0): void
to
public static function dof(string $function, array $arguments=[], array $options=[]): void
in\TamerLib > tm > dof()
to represent the changes made totm::do()
as described above. - Changed method
public static function wait(?callable $callback=null, int $timeout=0): void
to
public static function wait(int $timeout=0): void
as the function itself will now handle the result of the job
using the callback passed totm::do()
ortm::dof()
when the job is done.
Fixed
- Fixed synchronization issue in TamerLib where callbacks would run indefinitely if further jobs were added to the
queue while the callback was running.
Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download
- Implemented