Skip to content

[job-queue] CalculateRootJobStatusProcessor subscribed to command instead of topic #729

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

Closed
you-ser opened this issue Jan 17, 2019 · 1 comment · Fixed by #735
Closed
Labels

Comments

@you-ser
Copy link

you-ser commented Jan 17, 2019

Problem:
CalculateRootJobStatusProcessor stop wotking after commit php-enqueue/job-queue@1362b4d

Description:
Class Enqueue\JobQueue\CalculateRootJobStatusProcessor now implementing CommandSubscriberInterface and subscribed to command :

Enqueue\JobQueue\Commands::CALCULATE_ROOT_JOB_STATUS

But, class Enqueue\JobQueue\JobProcessor at method sendCalculateRootJobStatusEvent sending an event by producer, not command, so root job status is never updates.

//JobProcessor.php
/**
     * @see https://github.com/php-enqueue/enqueue-dev/pull/222#issuecomment-336102749 See for rationale
     *
     * @param Job $job
     */
    protected function sendCalculateRootJobStatusEvent(Job $job)
    {
        $this->producer->sendEvent(Commands::CALCULATE_ROOT_JOB_STATUS, [
            'jobId' => $job->getId(),
        ]);
    }

Possible solution:
1 - CalculateRootJobStatusProcessor should implement TopicSubscriberInterface again.
2 - JobProcessor should sent command instead of event at method sendCalculateRootJobStatusEvent

@you-ser you-ser changed the title [job-queue] CalculateRootJobStatusProcessor subscribe to command instead of topic [job-queue] CalculateRootJobStatusProcessor subscribed to command instead of topic Jan 17, 2019
@makasim
Copy link
Member

makasim commented Jan 17, 2019

sendEvent should be replaced with sendCommand

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

Successfully merging a pull request may close this issue.

2 participants