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

[5.x] Speared the producer and the consumer #261

Open
papac opened this issue Sep 20, 2023 · 0 comments
Open

[5.x] Speared the producer and the consumer #261

papac opened this issue Sep 20, 2023 · 0 comments
Assignees

Comments

@papac
Copy link
Member

papac commented Sep 20, 2023

Actually, the producer is also the consumer

You should spread this to the producer and consumer.

class Producer extends ProducerService
{
    public function __construct(private int $user_id)
    {}
}
class Consumer
{
   public function __construct(private UserService $userService){}

   public function process(ProducerService $producer)
   {
      $user_id = $producer->getUser();
      $userService->sendEmail($user_id);
   }
}
@papac papac added this to v5 Sep 20, 2023
@papac papac self-assigned this Sep 20, 2023
@papac papac converted this from a draft issue Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🔖 Ready
Development

No branches or pull requests

1 participant