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

Allow multiple recipients within single PushMessage #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mbordia-eightfold
Copy link

@mbordia-eightfold mbordia-eightfold commented Dec 26, 2022

Idea is to reduce number of network calls when single message is sent to multiple recipients.
Basically, condensing multiple messages into one single push message.

Related Issue : #52

@@ -401,6 +412,9 @@ def publish(self, push_message):
Returns:
A PushTicket object which contains the results.
"""
if isinstance(push_message.to, list) and len(push_message.to) > 1:
raise ValueError("Sending notification to multiple recipients is not allowed \
with publish method. Use publish_multiple method instead.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

you opted to just not allow it?

Is it easy enough to implement?

@@ -414,6 +428,9 @@ def publish_multiple(self, push_messages):
"""
push_tickets = []
for start in itertools.count(0, self.max_message_count):
# Todo : Check if len(push_message.to) check is required here as well
Copy link
Collaborator

Choose a reason for hiding this comment

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

From reading the docs it looks like it's 100 total (including the different ones, or same one with multiple "to's"

@sergioisidoro
Copy link

Status on this? This seems usefeul, given the api allows for multiple recipients, and this is just removing some validation safeguards? Why not just remove that sanity check?

@Fwnoledge
Copy link

Is this pull request going to be merged? It will be useful.

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

Successfully merging this pull request may close these issues.

4 participants