Skip to content

Commit

Permalink
Update required RoadRunner version and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed Feb 11, 2025
1 parent 95a93eb commit f0c1ff4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"roadrunner-php/roadrunner-api-dto": "^1.10.0",
"roadrunner-php/version-checker": "^1.0.1",
"spiral/attributes": "^3.1.8",
"spiral/roadrunner": "^2024.3.2",
"spiral/roadrunner": "^2024.3.3",
"spiral/roadrunner-cli": "^2.6",
"spiral/roadrunner-kv": "^4.3",
"spiral/roadrunner-worker": "^3.6.1",
Expand Down
37 changes: 36 additions & 1 deletion src/Workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,42 @@ public static function allHandlersFinished(): bool
}

/**
* Upsert Memo
* Updates this Workflow's Memos by merging the provided memo with existing Memos.
*
* New Memo is merged by replacing properties of the same name at the first level only.
* Setting a property to {@see null} clears that key from the Memo.
*
* For example:
*
* ```php
* Workflow::upsertMemo([
* 'key1' => 'value',
* 'key3' => ['subkey1' => 'value']
* 'key4' => 'value',
* });
*
* Workflow::upsertMemo([
* 'key2' => 'value',
* 'key3' => ['subkey2' => 'value']
* 'key4' => null,
* ]);
* ```
*
* would result in the Workflow having these Memo:
*
* ```php
* [
* 'key1' => 'value',
* 'key2' => 'value',
* 'key3' => ['subkey2' => 'value'], // Note this object was completely replaced
* // Note that 'key4' was completely removed
* ]
* ```
*
* @param array<string, mixed> $values
*
* @since SDK 2.13.0
* @since RoadRunner 2024.3.3
*/
public static function upsertMemo(array $values): void
{
Expand All @@ -933,6 +966,8 @@ public static function upsertSearchAttributes(array $searchAttributes): void
* );
* ```
*
* @since SDK 2.13.0
* @since RoadRunner 2024.3.2
* @link https://docs.temporal.io/visibility#search-attribute
*/
public static function upsertTypedSearchAttributes(SearchAttributeUpdate ...$updates): void
Expand Down
6 changes: 6 additions & 0 deletions src/Workflow/WorkflowContextInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ public function allHandlersFinished(): bool;
* ```
*
* @param array<non-empty-string, mixed> $values
*
* @since SDK 2.13.0
* @since RoadRunner 2024.3.3
* @link https://docs.temporal.io/glossary#memo
*/
public function upsertMemo(array $values): void;

Expand All @@ -347,6 +351,8 @@ public function upsertSearchAttributes(array $searchAttributes): void;
* );
* ```
*
* @since SDK 2.13.0
* @since RoadRunner 2024.3.2
* @link https://docs.temporal.io/visibility#search-attribute
*/
public function upsertTypedSearchAttributes(SearchAttributeUpdate ...$updates): void;
Expand Down

0 comments on commit f0c1ff4

Please sign in to comment.