github roadrunner-server/roadrunner v2023.3.0

latest releases: v2024.2.1, v2024.2.0, v2024.1.5...
11 months ago

Description of Changes

๐Ÿš€ v2023.3.0 ๐Ÿš€

๐Ÿ”ฅ Features:

RR Core:

๐Ÿ‘€ JOBS plugin:

  • โœ’๏ธ AMQP Driver: Support for a custom routing_key in the JOBS payload: FR, (thanks @rauanmayemir)
  • โœ’๏ธ JOBS plugin: Parallel pipelines start/stop/destroy initialization. If you have much number of the pipelines,
    this feature should significantly reduce RR startup/shutdown time: FR, (thanks @Kaspiman)

๐Ÿ‘€ KV drivers (all):

  • โœ’๏ธ Support for OTEL across all KV drivers: FR

๐Ÿ‘€ App-Logger plugin:

  • โœ’๏ธ Added new methods for your logger to log with context (message + key-values array): FR, (thanks @Baiquette)

๐Ÿ‘€ Temporal plugin:

  • โœ’๏ธ Replay API support [SINCE PHP-SDK 2.6.0]: FR
  • โœ’๏ธ Add support for the Worker Versioning: FR

๐Ÿ‘€ Service plugin:

  • โœ’๏ธ Support for the user/group per-service: FR, (thanks @Kaspiman)

Configuration example:

service:
    schedule:run:
        command: "bin/console schedule:run"
        process_num: 1
        exec_timeout: 0s
        remain_after_exit: true
        service_name_in_log: false
        restart_sec: 60
        user: www-data  # <---------- [NEW]
        group: www-data # <---------- [NEW]

๐Ÿ‘€ HTTP plugin:

  • โœ’๏ธ Response streaming support FR, (thanks @roxblnfk)

Worker example:

<?php

require __DIR__ . '/vendor/autoload.php';

use Spiral\RoadRunner;

ini_set('display_errors', 'stderr');
require __DIR__ . "/vendor/autoload.php";

$worker = RoadRunner\Worker::create();
$http = new RoadRunner\Http\HttpWorker($worker);
$read = static function (): Generator {
    foreach (\file(__DIR__ . '/test.txt') as $line) {
        try {
            yield $line;
        } catch (Spiral\RoadRunner\Http\Exception\StreamStoppedException) {
            // Just stop sending data
            return;
        }
    }
};

try {
    while ($req = $http->waitRequest()) {
        $http->respond(200, $read());
    }
} catch (\Throwable $e) {
    $worker->error($e->getMessage());
}
  • โœ’๏ธ Support for the 103 Early Hints via streamed response: FR, (thanks @azjezz)

Worker example:

<?php

use Spiral\RoadRunner;

ini_set('display_errors', 'stderr');
require __DIR__ . "/vendor/autoload.php";

$worker = RoadRunner\Worker::create();
$http = new RoadRunner\Http\HttpWorker($worker);
$read = static function (): Generator {
    $limit = 10;
    foreach (\file(__DIR__ . '/test.txt') as $line) {
        foreach (explode('"', $line) as $chunk) {
            try {
                usleep(50_000);
                yield $chunk;
            } catch (Spiral\RoadRunner\Http\Exception\StreamStoppedException $e) {
                // Just stop sending data
                return;
            }
            if (--$limit === 0) {
                return;
            }
        }
    }
};


try {
    while ($req = $http->waitRequest()) {
        $http->respond(103, '', headers: ['Link' => ['</style111.css>; rel=preload; as=style'], 'X-103' => ['103']], endOfStream: false);
        $http->respond(200, $read(), headers: ['X-200' => ['200']], endOfStream: true); // your regular response
    }
} catch (\Throwable $e) {
    $worker->error($e->getMessage());
}

๐Ÿ‘€ Server plugin:

  • โœ’๏ธ RAW command support: Support for raw commands, which are not validated by RR and may contain spaces. Note that this feature is only supported via .rr.yaml configuration: FR, (thanks @nunomaduro)
    First argument should be a command (executable) and the rest of the arguments are passed to the command as arguments.
version: "3"

server:
  command: ["php", "../../php_test_files/client.php echo pipes"]
  relay: "pipes"
  relay_timeout: "20s"
version: "3"

server:
    command:
      - "php"
      - "../../php_test_files/client.php echo pipes"
    relay: "pipes"
    relay_timeout: "20s"

๐Ÿฉน Fixes:

  • ๐Ÿ› RR Core: Actualize, according to the docs ./rr jobs list/stop/resume commands: PR, (thanks @gam6itko).
  • ๐Ÿ› JOBS plugin: Correctly handle OTEL span on listener error: PR, (thanks @Kaspiman).
  • ๐Ÿ› RR tests: Fix tests failures on Darwin: PR, (thanks @shyim).
  • ๐Ÿ› Streaming: Add stream timeout (will be configurable in the next release). Fix loss of the first chunk of the streamed response.

๐Ÿงน Chore:

  • ๐Ÿง‘โ€๐Ÿญ Golang: Update Golang version to v1.21.
  • ๐Ÿง‘โ€๐Ÿญ Dependencies: update project dependencies.

Don't miss a new roadrunner release

NewReleases is sending notifications on new releases.