Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] List of available plugins #611

Closed
SerafimArts opened this issue Mar 24, 2021 · 2 comments · Fixed by #652
Closed

[FEATURE REQUEST] List of available plugins #611

SerafimArts opened this issue Mar 24, 2021 · 2 comments · Fixed by #652
Assignees
Labels
C-feature-accepted Category: Feature discussed and accepted Y-Medium Priority: Medium
Milestone

Comments

@SerafimArts
Copy link
Contributor

When starting a worker, it makes sense to pass a list of available plugins to env variables, like:

RR_PLUGINS=temporal,jobs,http,grpc

This information is required to determine the presence and/or availability of some external service. A simple example that implements a polyfill for queues (jobs) when they are absent (or when they are disabled) in the RR:

class Factory
{

    // ....
    
    public function create(): QueueInterface
    {
        if ($this->env->isAvailable('jobs')) {
            return new Queue($this->rpc);
        }

        return new SyncQueue();
    }
}
@SerafimArts SerafimArts added the C-feature-request Category: feature requested, but need to be discussed label Mar 24, 2021
@rustatian rustatian added this to the unplanned milestone Mar 24, 2021
@rustatian
Copy link
Member

It's not possible to do that via the env variable. Because the server which starts a PHP process can be in the middle of the topological sorted graph. The second reason is that the config does not represent the actual set of the running plugins (some of them might be disabled) (as for the solution to read the .rr.yaml to determine the plugins set).

The possible solution that I see here is to ask endure after the Serve stage about the actual plugins set. And provide the list via some RPC call. But this is my first thought about the problem. Expected to be in the SPRINT 2021-05-04 (not sure).

@rustatian
Copy link
Member

The second solution is to use Status plugin for that purpose (which is used to provide different statuses about the runtime). Create an additional RPC call and add IsActive method to the interface. IsActive method (go) will grab all plugins which fit the interface and provide the list to the PHP.

@rustatian rustatian removed this from the unplanned milestone Mar 28, 2021
@rustatian rustatian added C-feature-accepted Category: Feature discussed and accepted Y-Medium Priority: Medium and removed C-feature-request Category: feature requested, but need to be discussed labels Mar 28, 2021
@rustatian rustatian added this to the 2.2.0 milestone Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-accepted Category: Feature discussed and accepted Y-Medium Priority: Medium
Projects
None yet
2 participants