Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
256dpi committed Sep 27, 2021
1 parent 4bc5fa2 commit 0b2f940
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,15 @@ type Config struct {
// underlying buffered writer.
MaxWriteDelay time.Duration

// AlwaysAnnounceOnPublish defines when the message callback handler is called.
// QOS 0,1: callback always occurs on reception of Publish
// QOS 2 and AlwaysAnnounceOnPublish == false: callback occurs on reception of PubRel and returning and error in
// the callback will close the connection before PubComp is sent.
// QOS 2 and AlwaysAnnounceOnPublish == true: callback occurs on reception of Publish and returning an error in
// the callback will close the connection, preventing PubRec being sent, thus ensuring redelivery of publish.
// AlwaysAnnounceOnPublish defines when the message callback is called.
// - QOS 0 and 1: Callback always occurs on reception of Publish.
// - QOS 2 and AlwaysAnnounceOnPublish == false: Callback occurs on
// reception of PubRel and returning and error in the callback will close
// the connection before PubComp is sent.
// - QOS 2 and AlwaysAnnounceOnPublish == true: Callback occurs on reception
// of Publish and returning an error in the callback will close the
// connection, preventing PubRec being sent, thus ensuring the redelivery
// of Publish.
AlwaysAnnounceOnPublish bool
}

Expand Down
3 changes: 2 additions & 1 deletion client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ type Service struct {
// The session used by the client to store unacknowledged packets.
Session Session

// The OnlineCallback is called when the service is connected.
// The OnlineCallback is called when the service is connected, but before
// topics are resubscribed.
//
// Note: Execution of the service is resumed after the callback returns.
// This means that waiting on a future inside the callback will deadlock the
Expand Down

0 comments on commit 0b2f940

Please sign in to comment.