• 2.1.0 499a871ce5

    2.1.0 Stable

    netkas released this 2023-07-07 04:31:51 +00:00 | 10 commits to master since this release

    Added

    • Implemented ausleep() in for TamerLib\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 from JobPacket instead of calling
      the server for the same information if the passed parameter (usually $job_id) is an instance of JobPacket,
      this reduces the number of calls to the server and improves performance.
    • Updated some methods in TamerLib > tm to use asleep instead of sleep 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 to net.nosial.loglib
    • Changed method public static function do(string $function, array $arguments=[], int $channel=0): int
      to public 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 when tm::wait()
      is called, additionally some options can be passed to the job such as channel 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 to tm::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 to tm::do() or tm::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