roadrunner-bridge

🌉 RoadRunner bridge to Spiral Framework

MIT License

Downloads
75.5K
Stars
13
Committers
7

Bot releases are visible (Hide)

roadrunner-bridge - v4.0.0-RC1 Latest Release

Published by roxblnfk about 1 month ago

What was changed

  • Sync with Spiral 3.14

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/v4.0.0-alpha2...v4.0.0-RC1

roadrunner-bridge - v3.7.0

Published by roxblnfk about 2 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/v3.6.2...v3.7.0

roadrunner-bridge - v4.0.0-alpha2

Published by roxblnfk about 2 months ago

Interceptors

Full integration with interceptors of Spiral v3.14.
In interceptors, you can interact with the request context, modify the input, handle the output, and perform any actions just before calling the target method.

Container Scopes

Added support for container scopes. Each worker will open the corresponding scopes immediately after initialization (dispatcher scope) and before running interceptors (context scope).
Dispatcher scopes are used to limit service bindings. Contextu scopes limits the context. For example, in the HTTP module, the context is ServerRequestInterface from PSR-7. Corresponding contexts have been added for the others as well.

HTTP:

  • http - dispatcher scope
  • http-request - context scope
  • \Psr\Http\Message\ServerRequestInterface - context class

Centrifugo:

  • centrifugo - dispatcher scope
  • centrifugo-request - context scope
  • \RoadRunner\Centrifugo\Request\RequestInterface - context class

gRPC (server):

  • grpc - dispatcher scope
  • grpc-request - context scope
  • \Spiral\RoadRunnerBridge\GRPC\UnaryCallInterface - context class

Queue:

  • queue - dispatcher scope
  • queue-task - context scope
  • \Spiral\Queue\TaskInterface - context class

TCP:

  • tcp - dispatcher scope
  • tcp-request - context scope
  • \Spiral\RoadRunner\Tcp\RequestInterface - context class

gRPC

Performance

The worker initialization time has been significantly optimized by using
tokenizer listeners
when searching for gRPC services.

Client

The responsibility for making client gRPC calls has been moved to the spiral/grpc-client package, which is included by default.

Generating client classes is no longer required, as spiral/grpc-client generates the necessary proxy classes at runtime.
That's why all the extra generators (BootloaderGenerator, ConfigGenerator, ClientGenerator) and client-related classes have been removed from this package.

To configure spiral/grpc-client, a client section has been added to the gRPC configuration:

return [
    // File 'app/config/grpc.php'
    // ... other options ...

    'client' => new GrpcClientConfig(
        interceptors: [
            SetTimoutInterceptor::createConfig(6_000),
            RetryInterceptor::createConfig(
                maximumAttempts: 1,
            ),
            ExecuteServiceInterceptors::class,
        ],
        services: [
            new \Spiral\Grpc\Client\Config\ServiceConfig(
                connections: ConnectionConfig::createInsecure('localhost:9001'),
                interfaces: [
                    \GRPC\Mailer\MailerServiceInterface::class,
                    \GRPC\Mailer\PingerServiceInterface::class,
                ],
            ),
        ],
    )
];

Refer to the spiral/grpc-client documentation for more information.

roadrunner-bridge - v4.0.0-alpha

Published by roxblnfk 3 months ago

Interceptors

Full integration with interceptors of Spiral v3.14.
In interceptors, you can interact with the request context, modify the input, handle the output, and perform any actions just before calling the target method.

Container Scopes

Added support for container scopes. Each worker will open the corresponding scopes immediately after initialization (dispatcher scope) and before running interceptors (context scope).
Dispatcher scopes are used to limit service bindings. Contextu scopes limits the context. For example, in the HTTP module, the context is ServerRequestInterface from PSR-7. Corresponding contexts have been added for the others as well.

HTTP:

  • http - dispatcher scope
  • http.request - context scope
  • \Psr\Http\Message\ServerRequestInterface - context class

Centrifugo:

  • centrifugo - dispatcher scope
  • centrifugo.request - context scope
  • \RoadRunner\Centrifugo\Request\RequestInterface - context class

gRPC (server):

  • grpc - dispatcher scope
  • grpc.request - context scope
  • \Spiral\RoadRunnerBridge\GRPC\UnaryCallInterface - context class

Queue:

  • queue - dispatcher scope
  • queue.task - context scope
  • \Spiral\Queue\TaskInterface - context class

TCP:

  • tcp - dispatcher scope
  • tcp.request - context scope
  • \Spiral\RoadRunner\Tcp\RequestInterface - context class

gRPC

Performance

The worker initialization time has been significantly optimized by using
tokenizer listeners
when searching for gRPC services.

Client

The responsibility for making client gRPC calls has been moved to the spiral/grpc-client package, which is included by default.

Generating client classes is no longer required, as spiral/grpc-client generates the necessary proxy classes at runtime.
That's why all the extra generators (BootloaderGenerator, ConfigGenerator, ClientGenerator) and client-related classes have been removed from this package.

To configure spiral/grpc-client, a client section has been added to the gRPC configuration:

return [
    // File 'app/config/grpc.php'
    // ... other options ...

    'client' => new GrpcClientConfig(
        interceptors: [
            SetTimoutInterceptor::createConfig(6_000),
            RetryInterceptor::createConfig(
                maximumAttempts: 1,
            ),
            ExecuteServiceInterceptors::class,
        ],
        services: [
            new \Spiral\Grpc\Client\Config\ServiceConfig(
                connections: ConnectionConfig::createInsecure('localhost:9001'),
                interfaces: [
                    \GRPC\Mailer\MailerServiceInterface::class,
                    \GRPC\Mailer\PingerServiceInterface::class,
                ],
            ),
        ],
    )
];

Refer to the spiral/grpc-client documentation for more information.

roadrunner-bridge - v3.6.2

Published by roxblnfk 3 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/v3.6.1...v3.6.2

roadrunner-bridge - v3.6.1

Published by roxblnfk 4 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/v3.6.0...v3.6.1

roadrunner-bridge - v3.6.0

Published by butschster 5 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/v3.5.0...v3.6.0

roadrunner-bridge - v3.5.0

Published by msmakouz 6 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/3.4.0...v3.5.0

roadrunner-bridge - v3.4.0

Published by butschster 8 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/3.3.1...3.4.0

roadrunner-bridge - v3.3.1

Published by butschster 10 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/3.3.0...3.3.1

roadrunner-bridge - v3.3.0

Published by butschster 10 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/3.2.0...3.3.0

roadrunner-bridge - v3.2.0

Published by butschster 10 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/3.1.0...3.2.0

roadrunner-bridge - v3.1.0

Published by butschster 10 months ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/3.0.2...3.1.0

roadrunner-bridge - v3.0.2

Published by butschster about 1 year ago

roadrunner-bridge - v3.1.1

Published by butschster about 1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/3.0.0...3.0.1

roadrunner-bridge - v3.0.0

Published by butschster over 1 year ago

New features

Updated Queue component.

  • Updates spiral/roadrunner-jobs package up to 4.0 version
  • Removes Serializer Adapter. Now consumer always receives a task with string payload and then uses spiral/serializer component to deserialize it.
  • Pipelines section in config moves into root of queue config
return [
    'default' => env('QUEUE_CONNECTION', 'roadrunner'),

    'connections' => [
        'in-memory' => [
            'driver' => 'roadrunner',
            'pipeline' => 'memory',  // <======= Pipeline that will be used in connection
        ],
    ],

    'defaultSerializer' => 'closure',

    'pipelines' => [  // <=============== Pipelines section
        'memory' => [
            'connector' => new MemoryCreateInfo('local'),
            'consume' => true,
        ],
    ],
];
  • Adds earlier declaration of pipelines with consuming.

    • If there is a pipeline with consume=true declaration, it will be declared automatically during application bootstrapping.
    • Pipeline will be declared only on worker starting in Jobs mode.
  • rr:jobs:consume console command declares a pipeline if it wasn't declared and there is a declaration in config for it

Other changes

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/2.6.0...3.0.0

roadrunner-bridge - v2.6.0

Published by butschster over 1 year ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/2.5.1...2.6.0

roadrunner-bridge - v2.5.1

Published by butschster over 1 year ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/2.5.0...2.5.1

roadrunner-bridge - v2.5.0

Published by butschster over 1 year ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/2.4.0...2.5.0

roadrunner-bridge - v2.4.0

Published by butschster over 1 year ago

What's Changed

Full Changelog: https://github.com/spiral/roadrunner-bridge/compare/2.3.2...2.4.0

Package Rankings
Top 4.84% on Packagist.org
Badges
Extracted from project README
PHP Version Require Latest Stable Version phpunit psalm Codecov Total Downloads StyleCI
Related Projects