-
Notifications
You must be signed in to change notification settings - Fork 85
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
docs(app-sdk): Add background publisher API detail #229
Conversation
Please note - this is a draft PR for the hanoi release, linked to edgexfoundry/app-functions-sdk-go#466 |
defer close(done) | ||
|
||
//pass the publisher to your jobs | ||
for _, j := range jobs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be helpful to show example of Job using the publisher to send the data to complete the picture
. Also jobs
isn't define in sample so might want to change comment to pass the publisher to your jobs (defined elsewhere)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea to show a more detailed example, I'll just code a simple loop to use it inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left the actual message construction as an exercise for the user, but added a simple method demonstrating usage of the publisher to the doc. Tried not to make the code sample too much longer so I left out logging calls etc...
There is a drop down when you create the PR where you can select |
if err != nil { | ||
continue | ||
} | ||
pub.Publish(, fmt.Sprintf("background=%d", time.Now().UnixNano()), clients.ContentTypeJSON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing payload
as first parameter.
Also recommend set correlationId = uuid.New().String()
and passing it to Publish
so it is more explicit and uses standard UUID used else where for correlation ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh should be good now
Adds a simple paragraph and code example for using background publisher API References: #462 Signed-off-by: Alex Ullrich <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: edgex-jenkins <[email protected]>
Adds a simple paragraph and code example for using background publisher
API
References: #462
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number:
462
What has been updated?
Are there any specific instructions or things that should be known prior to reviewing?
Other information