Conversation
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
antmendoza
left a comment
There was a problem hiding this comment.
Thanks @tsurdilo
Having different paths within the same workflow (rather than child workflows) makes it difficult to understand what is happening to each parcel in the UI. Perhaps activity.summary could help with this
| ``` | ||
|
|
||
| Run sample multiple times to see different scenarios (delivery failure and retry and delivery cancelation) | ||
| There is a 10% chance delivery is going to be canceled and 20% chane it will fail. No newline at end of file |
There was a problem hiding this comment.
| There is a 10% chance delivery is going to be canceled and 20% chane it will fail. | |
| There is a 10% chance delivery is going to be canceled and a 20% chance it will fail. |
There was a problem hiding this comment.
It might be helpful as well to have a comment here (in the README.md) or in the code regarding the event history length and CAN
| if (!packetDeliveries.get(deliveryId).getDelivered().isCompleted()) { | ||
| logger.info("Sending cancellation for delivery : " + deliveryId + " and reason: " + reason); | ||
| packetDeliveries.get(deliveryId).cancelDelivery(reason); | ||
| } |
There was a problem hiding this comment.
I believe an else is missing here
There was a problem hiding this comment.
its on purpose, we dont want to call cancelDelivery on a packet if its already completed (its completable future completed)
| // more | ||
| while (true) { | ||
| sleep(3); | ||
| // for "fun", reverse the list we get from delivery confirmation list |
There was a problem hiding this comment.
Thank you. Removed duplicate
| for (int i = 0; i < 4; i++) { | ||
| try { | ||
| // Perform the heartbeat. Used to notify the workflow that activity execution is alive | ||
| context.heartbeat(i); |
There was a problem hiding this comment.
Is the idea here to have a "long-running" activity that can be cancelled? Activity execution latency in this example is between 5-7 ms and heartbeatTimeout is 2 seconds.
There was a problem hiding this comment.
its to handle cancelation in activity, similar to HelloCancellation sample
There was a problem hiding this comment.
Understand, . Of all the times I’ve run the example, none have resulted in a cancelled activity. maybe 7 ms is not enough, but I will try again later
There was a problem hiding this comment.
Yeah you can change the "percentages" of cancel / failure to increase change for cancelation locally
| for (int i = 0; i < 4; i++) { | ||
| try { | ||
| // Perform the heartbeat. Used to notify the workflow that activity execution is alive | ||
| context.heartbeat(i); |
There was a problem hiding this comment.
Understand, . Of all the times I’ve run the example, none have resulted in a cancelled activity. maybe 7 ms is not enough, but I will try again later
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Signed-off-by: Tihomir Surdilovic <tihomir@temporal.io>
Packet delivery sample - runs multiple packet deliveries paths async within same execution