Skip to content

Commit b0803e8

Browse files
authored
Expose retry policy in activity context (#656): Expose retry policy in activity context
2 parents 728df25 + 7ff136e commit b0803e8

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"nesbot/carbon": "^2.72.6 || ^3.8.4",
3333
"psr/log": "^2.0 || ^3.0.2",
3434
"ramsey/uuid": "^4.7.6",
35-
"roadrunner-php/roadrunner-api-dto": "^1.13.0",
36-
"roadrunner-php/version-checker": "^1.0.1",
35+
"roadrunner-php/roadrunner-api-dto": "^1.14.0",
36+
"roadrunner-php/version-checker": "^1.0.2",
3737
"spiral/attributes": "^3.1.8",
38-
"spiral/roadrunner": "^2025.1.3",
38+
"spiral/roadrunner": "^2025.1.5",
3939
"spiral/roadrunner-cli": "^2.6",
4040
"spiral/roadrunner-kv": "^4.3.1",
4141
"spiral/roadrunner-worker": "^3.6.2",

dload.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
temp-dir="./runtime"
55
>
66
<actions>
7-
<download software="rr" version="^2025.1.3"/>
7+
<download software="rr" version="^2025.1.5"/>
88
<download software="temporal" version="^1.4-fairness@dev"/>
99
<download software="temporal-tests-server"/>
1010
</actions>

src/Activity/ActivityInfo.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Temporal\Activity;
1818
use Temporal\Client\ActivityCompletionClientInterface;
1919
use Temporal\Common\Priority;
20+
use Temporal\Common\RetryOptions;
2021
use Temporal\Common\Uuid;
2122
use Temporal\Internal\Marshaller\Meta\Marshal;
2223
use Temporal\Internal\Marshaller\Type\DateIntervalType;
@@ -108,6 +109,9 @@ final class ActivityInfo
108109
#[Marshal(name: 'Priority')]
109110
public Priority $priority;
110111

112+
#[Marshal(name: 'RetryPolicy')]
113+
public ?RetryOptions $retryOptions = null;
114+
111115
/**
112116
* ActivityInfo constructor.
113117
*/

tests/Acceptance/Extra/Activity/ActivityInfoTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ public static function retryPolicy(
2222
#[Stub('Extra_Activity_ActivityInfo', args: [TestWorkflow::ARG_RETRY_OPTIONS])]
2323
WorkflowStubInterface $stub,
2424
): void {
25-
self::markTestSkipped('See https://github.com/temporalio/sdk-php/issues/602');
26-
2725
$result = $stub->getResult(type: 'array');
2826
self::assertSame([
2927
"initial_interval" => ['seconds' => 1, 'nanos' => 0],
30-
"backoff_coefficient" => 3,
28+
"backoff_coefficient" => 3.0,
3129
"maximum_interval" => ['seconds' => 120, 'nanos' => 0],
3230
"maximum_attempts" => 20,
3331
"non_retryable_error_types" => [],

tests/Unit/DTO/ActivityInfoTestCase.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function testMarshalling(): void
4242
'fairness_key' => '',
4343
'fairness_weight' => 0.0,
4444
],
45+
'RetryPolicy' => null,
4546
];
4647

4748
$this->assertSame($expected, $this->marshal($dto));

0 commit comments

Comments
 (0)