Add an example for multiple callbacks for an active span.#1
Merged
malafeev merged 3 commits intoopentracing-contrib:masterfrom Aug 15, 2017
Merged
Conversation
malafeev
reviewed
Aug 15, 2017
| executor.submit(new Callable<Object>() { | ||
| @Override | ||
| public Object call() throws Exception { | ||
| logger.info("Child thread with message '" + message + "' started"); |
There was a problem hiding this comment.
logger.info("Child thread with message '{}' started", message);
| } | ||
| } | ||
|
|
||
| logger.info("Child thread with message '" + message + "' finished"); |
There was a problem hiding this comment.
logger.info("Child thread with message '{}' finished", message);
malafeev
reviewed
Aug 15, 2017
| client.send("task1", span, 100); | ||
| client.send("task2", span, 200); | ||
| client.send("task3", span, 300); | ||
| } |
There was a problem hiding this comment.
if we change order 100, 200, 300 to 100, 300, 200 will it be OK?
Collaborator
Author
There was a problem hiding this comment.
Yes, that's ok (just tested it). I was even going to make them sleep randomly, but I wanted the example to be clear about that (reversing their sleep time would still be fine as the user can still see such value).
malafeev
approved these changes
Aug 15, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added an example to show how a master task can have a few subtasks, and needs to have its Span closed upon the last one completes.
Haven't been working on OT directly in Java, so let me know in case of any feedback ;)