Skip to content

[Bug] WorkerFactoryInterface seems to be missing arguments for newWorker() method #573

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

Open
vansante opened this issue Feb 20, 2025 · 3 comments
Milestone

Comments

@vansante
Copy link

What are you really trying to do?

Setting a ExceptionInterceptorInterface and PipelineProvider with the newWorker method.

Describe the bug

The interface method is:

    public function newWorker(
        string $taskQueue = self::DEFAULT_TASK_QUEUE,
        ?WorkerOptions $options = null,
    ): WorkerInterface;

But the actual implementation is:

    public function newWorker(
        string $taskQueue = self::DEFAULT_TASK_QUEUE,
        ?WorkerOptions $options = null,
        ?ExceptionInterceptorInterface $exceptionInterceptor = null,
        ?PipelineProvider $interceptorProvider = null,
    ): WorkerInterface {
        // .. implementation
    }

Minimal Reproduction

Not really relevant, just install the sdk.

Environment/Versions

Also irrelevant.

Additional context

The interface should describe the full method with all arguments.

@vansante vansante added the Bug Something isn't working label Feb 20, 2025
@roxblnfk roxblnfk added this to the 3.0.0 milestone Feb 20, 2025
@roxblnfk
Copy link
Collaborator

The interface is in the public space, so changing it can be considered a breaking change (even though it's not intended to be implemented by the user). Overall, there is no strong reason to update it for now.

@roxblnfk roxblnfk added enhancement and removed Bug Something isn't working labels Feb 20, 2025
@vansante
Copy link
Author

Is it really a breaking change when they are defaulted to null anyway? That means they can be omitted right?

@roxblnfk
Copy link
Collaborator

If we add parameters to the interface method, we will break all implementations that we do not control.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants