Skip to content

Conversation

@vladvildanov
Copy link
Contributor

Closes #1308

@vladvildanov vladvildanov requested review from a team and chayim June 12, 2023 12:52
@vladvildanov vladvildanov requested a review from tillkruss as a code owner June 12, 2023 12:52
@vladvildanov vladvildanov linked an issue Jun 13, 2023 that may be closed by this pull request

foreach ($push as $notification) {
if ((null !== $notification) && $notification->getDataType() === PushResponseInterface::MESSAGE_DATA_TYPE) {
if ($notification[1] === 'control' && $notification[2] === 'terminate') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving control and terminate into things we can import + test against (const-y)

// Data types should be changed in near future. Instead of Message data type it should be one of kind data types.

$dispatcher->attachCallback(
PushResponseInterface::MESSAGE_DATA_TYPE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YES!

$client = new Client();

$this->assertInstanceOf('Predis\PubSub\Consumer', $client->pubSubLoop());
$this->assertInstanceOf('Predis\Consumer\PubSub\Consumer', $client->pubSubLoop());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH I preferred the old pathing. It looks prettier. Any way to approach it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chayim It was done to keep different entities within the same domain. There are a lot of "Consumers": PubSub, Sharded PubSub, Push Notifications. All of them "consume" messages from server. IMHO, it's better to create a separate place where we can keep all entities related to this domain, then spreading them across whole library.

@vladvildanov vladvildanov merged commit 6a1a2c4 into predis:feature/resp-3 Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

RESP3: Push notifications

2 participants