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

Add 'delivered' event on PUBACK handler #39

Merged
merged 5 commits into from
Mar 18, 2016

Conversation

pkinney
Copy link
Contributor

@pkinney pkinney commented Mar 16, 2016

This addresses #10 and emits a delivered event when a PUBACK is received.

@pkinney pkinney mentioned this pull request Mar 16, 2016
@mcollina
Copy link
Collaborator

Can you please do the same for PUBCOM and add the doc relative to this in the README?
Also, I will call that 'deliver' (we are already breaking backward compat with mosca :/).

@pkinney
Copy link
Contributor Author

pkinney commented Mar 17, 2016

Right now, the PUBCOMP case currently falls through to the PUBACK case (https://github.com/mcollina/aedes/blob/master/lib/handlers/index.js#L35-L38), so the change to the handlePuback function should handle both cases. I added a test for PUBCOMP to make sure and for regression tests.

I changed the event to 'deliver' and updated the test. Working on updates to README now.

@pkinney
Copy link
Contributor Author

pkinney commented Mar 17, 2016

README updated. Let me know if there is anything else to add.

client.publish({
topic: 'hello',
payload: new Buffer('world'),
qos: 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be qos:2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Corrected.

mcollina added a commit that referenced this pull request Mar 18, 2016
Add 'delivered' event on PUBACK handler
@mcollina mcollina merged commit 929b008 into moscajs:master Mar 18, 2016
@mcollina
Copy link
Collaborator

Release as v0.14.0

@@ -3,6 +3,7 @@
function handlePuback (client, packet, done) {
var persistence = client.broker.persistence
persistence.outgoingClearMessageId(client, packet, done)
client.broker.emit('deliver', packet, client)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe delivered or ack could be a better name, in Mosca we are using delivered @mcollina

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think 'ack' is the best of all, actually. I'll get that updated asap!
Il giorno dom 3 apr 2016 alle 18:14 Behrad notifications@github.com ha
scritto:

In lib/handlers/puback.js
#39 (comment):

@@ -3,6 +3,7 @@
function handlePuback (client, packet, done) {
var persistence = client.broker.persistence
persistence.outgoingClearMessageId(client, packet, done)

  • client.broker.emit('deliver', packet, client)

I believe delivered or ack could be a better name, in Mosca we are using
delivered @mcollina https://github.com/mcollina


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/mcollina/aedes/pull/39/files/7897baca0c9db516cd179f3d64497c9527b84f5a#r58312605

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.

3 participants