Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/polyglot/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ Remote workers register workflow, activity, query, and update handlers through
Use the generated [PHP SDK API reference](https://php.durable-workflow.com/api/)
for complete parameters and return types.

## Activity retry context and owning run {#activity-retry-context}

PHP SDK **3.6.1 or later** exposes `$context->retryInfo`, `$context->workflowId` and `$context->runId` in service-mode activities. Check `$context->retryInfo->isLastConfiguredAttempt() === true` for the final configured attempt of a bounded policy. `attemptNumber` preserves the original received attempt number.

The retry snapshot preserves three distinct states: `policyProvided === false` means the claim omitted the policy; a provided root `null` is unknown legacy policy; an object with explicit `max_attempts: null` means unlimited. `maxAttempts()` returning `null` alone does not establish unlimited retries. The SDK does not invent a default budget. Cancellation, non-retryable failure, workflow closure and elapsed deadlines can end execution before the budget is exhausted.

The workflow and run IDs identify the original owning run. Missing legacy identity stays `null`. Local activities retain known parent IDs without inheriting a remote retry policy. To signal the owning workflow, require both IDs, pin the signal to `runId` and reuse a stable business-event request ID across retries.

Keep signal processing idempotent for the business event. A stable request ID alone does not establish once-only signal admission.

See the [complete final-attempt and own-run signal examples](https://php.durable-workflow.com/build/workflows-activities/) in the PHP SDK guide.

## Activity heartbeats {#activity-heartbeats}

For remote activities, call `ActivityContext::heartbeat($details)` during bounded work, well before the configured heartbeat timeout. The first window starts at runtime claim, not when PHP receives the task. Request latency, pauses and transport retries consume that window. Follow the [cadence guidance](../features/heartbeats.md#heartbeat-cadence-and-receipts).
Expand Down
12 changes: 12 additions & 0 deletions i18n/de/docusaurus-plugin-content-docs/current/polyglot/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ Entfernte Worker registrieren Workflow-, Aktivitäts-, Abfrage- und Update-Handl
Vollständige Parameter und Rückgabetypen stehen in der generierten
[PHP-SDK-API-Referenz](https://php.durable-workflow.com/api/).

## Wiederholungskontext und zugehöriger Lauf einer Aktivität {#activity-retry-context}

Das PHP SDK **ab 3.6.1** stellt `$context->retryInfo`, `$context->workflowId` und `$context->runId` in Aktivitäten im Service-Modus bereit. Mit `$context->retryInfo->isLastConfiguredAttempt() === true` erkennen Sie den letzten konfigurierten Versuch einer begrenzten Richtlinie. `attemptNumber` bewahrt die ursprünglich empfangene Versuchsnummer.

Der Snapshot unterscheidet drei Zustände: `policyProvided === false` bedeutet, dass die Richtlinie im Claim fehlt. Ein übergebener Wurzelwert `null` bezeichnet eine unbekannte ältere Richtlinie. Ein Objekt mit explizitem `max_attempts: null` bedeutet unbegrenzte Versuche. Ein Rückgabewert `null` von `maxAttempts()` allein belegt keine unbegrenzten Wiederholungen. Das SDK erfindet kein Standardbudget. Abbruch, nicht wiederholbare Fehler, das Ende des Workflows und abgelaufene Fristen können die Ausführung vor Ausschöpfung des Budgets beenden.

Workflow- und Lauf-ID bezeichnen den ursprünglichen zugehörigen Lauf. Fehlende ältere Identitäten bleiben `null`. Lokale Aktivitäten behalten bekannte Eltern-IDs, ohne eine Richtlinie für entfernte Aktivitäten zu erben. Prüfen Sie vor einem Signal an den zugehörigen Workflow beide IDs, binden Sie das Signal an `runId` und verwenden Sie über Wiederholungen hinweg dieselbe stabile Request-ID des Geschäftsereignisses.

Verarbeiten Sie Signale für das Geschäftsereignis idempotent. Eine stabile Request-ID allein garantiert keine einmalige Signalannahme.

Die [vollständigen Beispiele zum letzten Versuch und zum Signal an den eigenen Lauf](https://php.durable-workflow.com/build/workflows-activities/) stehen im PHP-SDK-Leitfaden.

## Aktivitäts-Heartbeats {#activity-heartbeats}

Rufen Sie bei entfernten Aktivitäten `ActivityContext::heartbeat($details)` während begrenzter Aktivitätsarbeit deutlich vor dem konfigurierten Heartbeat-Zeitlimit auf. Das erste Zeitfenster beginnt mit der Beanspruchung durch die Laufzeit, nicht beim Empfang der Aufgabe in PHP. Anfragelatenz, Pausen und Transportwiederholungen verbrauchen dieses Zeitfenster. Beachten Sie die [Taktempfehlungen](../features/heartbeats.md#heartbeat-cadence-and-receipts).
Expand Down
2 changes: 1 addition & 1 deletion i18n/de/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"polyglot/invocable-carrier.md": "d32d8b5c7c33204b342f977e0af734166d91e96073db1a49ccb4d414a6d67380",
"polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13",
"polyglot/namespace-auth-workers.md": "2b4078ceb74b849f12cb1975b410ff8e7266cd4345f6cf1d4dd906db12460ffb",
"polyglot/php.md": "a13ba8d0c9641a21b6d921e94db5bd1a553c093f41c36d74f107ad8d9fe81e8a",
"polyglot/php.md": "5216eb8f0f37d36e6aee8cc67e4ec97b13a3f48218e7c00a5da3d16c3564bf6f",
"polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989",
"polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959",
"polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c",
Expand Down
12 changes: 12 additions & 0 deletions i18n/es/docusaurus-plugin-content-docs/current/polyglot/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ actualización mediante `registerWorkflow`, `registerActivity`, `registerQuery`
y `registerUpdate`. Consulta la [referencia generada del SDK de PHP](https://php.durable-workflow.com/api/)
para los parámetros y tipos de retorno completos.

## Contexto de reintentos y ejecución propietaria de una actividad {#activity-retry-context}

El SDK de PHP **3.6.1 o posterior** expone `$context->retryInfo`, `$context->workflowId` y `$context->runId` en las actividades en modo servicio. Compruebe `$context->retryInfo->isLastConfiguredAttempt() === true` para detectar el último intento configurado de una política limitada. `attemptNumber` conserva el número de intento recibido originalmente.

La instantánea distingue tres estados: `policyProvided === false` indica que la reclamación omitió la política; un valor raíz `null` recibido representa una política heredada desconocida; un objeto con `max_attempts: null` explícito significa intentos ilimitados. Que `maxAttempts()` devuelva `null` no basta para afirmar que los reintentos son ilimitados. El SDK no inventa un límite predeterminado. La cancelación, los fallos no reintentables, el cierre del workflow y los plazos vencidos pueden terminar la ejecución antes de agotar el límite.

Los ID del workflow y de la ejecución identifican la ejecución propietaria original. Las identidades heredadas ausentes permanecen en `null`. Las actividades locales conservan los ID conocidos del padre sin heredar una política de reintentos remota. Para enviar una señal al workflow propietario, exija ambos ID, dirija la señal a `runId` y reutilice un ID de solicitud estable del evento de negocio entre reintentos.

Procese las señales de forma idempotente para el evento de negocio. Un ID de solicitud estable por sí solo no garantiza la admisión única de la señal.

Consulte los [ejemplos completos del último intento y de señales a la ejecución propia](https://php.durable-workflow.com/build/workflows-activities/) en la guía del SDK de PHP.

## Heartbeats de actividad {#activity-heartbeats}

Para actividades remotas, llame a `ActivityContext::heartbeat($details)` durante trabajo de actividad acotado, con suficiente antelación al tiempo de espera de heartbeat. La primera ventana empieza al reclamar la actividad en el entorno de ejecución, no cuando PHP recibe la tarea. La latencia de las peticiones, las pausas y los reintentos de transporte consumen esa ventana. Siga las [recomendaciones de cadencia](../features/heartbeats.md#heartbeat-cadence-and-receipts).
Expand Down
2 changes: 1 addition & 1 deletion i18n/es/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"polyglot/invocable-carrier.md": "d32d8b5c7c33204b342f977e0af734166d91e96073db1a49ccb4d414a6d67380",
"polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13",
"polyglot/namespace-auth-workers.md": "2b4078ceb74b849f12cb1975b410ff8e7266cd4345f6cf1d4dd906db12460ffb",
"polyglot/php.md": "a13ba8d0c9641a21b6d921e94db5bd1a553c093f41c36d74f107ad8d9fe81e8a",
"polyglot/php.md": "5216eb8f0f37d36e6aee8cc67e4ec97b13a3f48218e7c00a5da3d16c3564bf6f",
"polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989",
"polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959",
"polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c",
Expand Down
12 changes: 12 additions & 0 deletions i18n/fr/docusaurus-plugin-content-docs/current/polyglot/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ requêtes de lecture et mises à jour via `registerWorkflow`,
La [référence d’API générée du SDK PHP](https://php.durable-workflow.com/api/)
donne tous les paramètres et types de retour.

## Contexte de reprise et exécution propriétaire d’une activité {#activity-retry-context}

Le SDK PHP **3.6.1 ou ultérieur** expose `$context->retryInfo`, `$context->workflowId` et `$context->runId` dans les activités en mode service. Vérifiez `$context->retryInfo->isLastConfiguredAttempt() === true` pour reconnaître la dernière tentative configurée d’une politique limitée. `attemptNumber` conserve le numéro de tentative reçu à l’origine.

L’instantané distingue trois états : `policyProvided === false` indique que la politique est absente de la tâche attribuée ; une valeur racine `null` fournie représente une ancienne politique inconnue ; un objet contenant explicitement `max_attempts: null` signifie des tentatives illimitées. Un retour `null` de `maxAttempts()` ne suffit pas à établir ce caractère illimité. Le SDK n’invente aucun budget par défaut. L’annulation, un échec non réessayable, la fermeture du workflow et l’expiration des délais peuvent arrêter l’exécution avant épuisement du budget.

Les identifiants du workflow et de l’exécution désignent l’exécution propriétaire d’origine. Une identité absente des anciennes tâches reste `null`. Les activités locales conservent les identifiants connus du parent sans hériter d’une politique de reprise distante. Pour signaler le workflow propriétaire, exigez les deux identifiants, ciblez `runId` et réutilisez un identifiant de requête stable lié à l’événement métier entre les tentatives.

Traitez les signaux de manière idempotente pour l’événement métier. Un identifiant de requête stable ne garantit pas à lui seul une admission unique du signal.

Consultez les [exemples complets de dernière tentative et de signal à sa propre exécution](https://php.durable-workflow.com/build/workflows-activities/) dans le guide du SDK PHP.

## Heartbeats d’activité {#activity-heartbeats}

Pour les activités distantes, appelez `ActivityContext::heartbeat($details)` pendant un travail d’activité borné, bien avant le délai de heartbeat configuré. La première fenêtre commence lorsque le moteur réclame l’activité, pas lorsque PHP reçoit la tâche. La latence des requêtes, les pauses et les nouvelles tentatives de transport consomment cette fenêtre. Suivez les [conseils de fréquence](../features/heartbeats.md#heartbeat-cadence-and-receipts).
Expand Down
2 changes: 1 addition & 1 deletion i18n/fr/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"polyglot/invocable-carrier.md": "d32d8b5c7c33204b342f977e0af734166d91e96073db1a49ccb4d414a6d67380",
"polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13",
"polyglot/namespace-auth-workers.md": "2b4078ceb74b849f12cb1975b410ff8e7266cd4345f6cf1d4dd906db12460ffb",
"polyglot/php.md": "a13ba8d0c9641a21b6d921e94db5bd1a553c093f41c36d74f107ad8d9fe81e8a",
"polyglot/php.md": "5216eb8f0f37d36e6aee8cc67e4ec97b13a3f48218e7c00a5da3d16c3564bf6f",
"polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989",
"polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959",
"polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c",
Expand Down
12 changes: 12 additions & 0 deletions i18n/ja/docusaurus-plugin-content-docs/current/polyglot/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ SDK 所有のクイックスタートは、空の Composer プロジェクトを

リモート Worker は `registerWorkflow`、`registerActivity`、`registerQuery`、`registerUpdate` でワークフロー、アクティビティ、クエリ、更新のハンドラーを登録します。完全なパラメーターと戻り値の型は、生成された [PHP SDK API リファレンス](https://php.durable-workflow.com/api/)を使ってください。

## アクティビティの再試行コンテキストと所属する実行 {#activity-retry-context}

PHP SDK **3.6.1 以降**では、サービスモードのアクティビティで `$context->retryInfo`、`$context->workflowId`、`$context->runId` を参照できます。回数制限のあるポリシーの最後の設定済み試行は、`$context->retryInfo->isLastConfiguredAttempt() === true` で判定します。`attemptNumber` は、受信した元の試行番号を保持します。

再試行スナップショットは、次の 3 つを区別します。`policyProvided === false` はクレームにポリシーが含まれていない状態、ルート値として渡された `null` は不明な旧形式のポリシー、明示的な `max_attempts: null` を含むオブジェクトは無制限の試行を意味します。`maxAttempts()` が `null` を返すだけでは、無制限とは判断できません。SDK はデフォルトの試行回数を補いません。キャンセル、再試行不能な失敗、ワークフローの終了、期限切れにより、回数を使い切る前に実行が終了することがあります。

ワークフロー ID と実行 ID は、元の所属先の実行を識別します。旧形式で欠落している ID は `null` のままです。ローカルアクティビティは既知の親 ID を保持しますが、リモート用の再試行ポリシーは引き継ぎません。所属先のワークフローにシグナルを送る際は両方の ID を必須とし、`runId` を指定して対象を固定し、再試行間で同じ業務イベントの安定したリクエスト ID を再利用してください。

業務イベントに対するシグナル処理は冪等にしてください。安定したリクエスト ID だけでは、シグナルが一度だけ受け付けられる保証にはなりません。

PHP SDK ガイドの[最終試行の判定と自身の実行へのシグナル送信の完全な例](https://php.durable-workflow.com/build/workflows-activities/)を参照してください。

## アクティビティのハートビート {#activity-heartbeats}

リモートアクティビティでは、上限を設けた処理の途中で、設定されたハートビートのタイムアウトより十分前に `ActivityContext::heartbeat($details)` を呼び出します。最初の期間はランタイムのタスク取得から始まり、PHP がタスクを受信した時点からではありません。リクエストの遅延、中断、通信の再試行も期間を消費します。[送信間隔の指針](../features/heartbeats.md#heartbeat-cadence-and-receipts)に従ってください。
Expand Down
2 changes: 1 addition & 1 deletion i18n/ja/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"polyglot/invocable-carrier.md": "d32d8b5c7c33204b342f977e0af734166d91e96073db1a49ccb4d414a6d67380",
"polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13",
"polyglot/namespace-auth-workers.md": "2b4078ceb74b849f12cb1975b410ff8e7266cd4345f6cf1d4dd906db12460ffb",
"polyglot/php.md": "a13ba8d0c9641a21b6d921e94db5bd1a553c093f41c36d74f107ad8d9fe81e8a",
"polyglot/php.md": "5216eb8f0f37d36e6aee8cc67e4ec97b13a3f48218e7c00a5da3d16c3564bf6f",
"polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989",
"polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959",
"polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c",
Expand Down
12 changes: 12 additions & 0 deletions i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/php.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ atualização por `registerWorkflow`, `registerActivity`, `registerQuery` e
`registerUpdate`. Use a [referência gerada da API do SDK PHP](https://php.durable-workflow.com/api/)
para parâmetros e tipos de retorno completos.

## Contexto de novas tentativas e execução proprietária da atividade {#activity-retry-context}

O SDK PHP **3.6.1 ou posterior** expõe `$context->retryInfo`, `$context->workflowId` e `$context->runId` nas atividades em modo de serviço. Verifique `$context->retryInfo->isLastConfiguredAttempt() === true` para identificar a última tentativa configurada de uma política limitada. `attemptNumber` preserva o número da tentativa recebido originalmente.

O snapshot distingue três estados: `policyProvided === false` indica que a tarefa recebida omitiu a política; um valor raiz `null` fornecido representa uma política legada desconhecida; um objeto com `max_attempts: null` explícito significa tentativas ilimitadas. O retorno `null` de `maxAttempts()` sozinho não comprova novas tentativas ilimitadas. O SDK não inventa um limite padrão. Cancelamento, falhas não recuperáveis por nova tentativa, encerramento do workflow e prazos vencidos podem terminar a execução antes de esgotar o limite.

Os IDs do workflow e da execução identificam a execução proprietária original. Identidades legadas ausentes permanecem `null`. Atividades locais preservam os IDs conhecidos do pai sem herdar uma política remota de novas tentativas. Para sinalizar o workflow proprietário, exija os dois IDs, direcione o sinal a `runId` e reutilize um ID de requisição estável do evento de negócio entre tentativas.

Processe os sinais de forma idempotente para o evento de negócio. Um ID de requisição estável, por si só, não garante a admissão única do sinal.

Consulte os [exemplos completos da última tentativa e do sinal para a própria execução](https://php.durable-workflow.com/build/workflows-activities/) no guia do SDK PHP.

## Heartbeats de atividade {#activity-heartbeats}

Para atividades remotas, chame `ActivityContext::heartbeat($details)` durante trabalho de atividade limitado, bem antes do tempo limite de heartbeat configurado. A primeira janela começa na reivindicação pelo runtime, não quando o PHP recebe a tarefa. Latência das requisições, pausas e novas tentativas de transporte consomem essa janela. Siga as [orientações de cadência](../features/heartbeats.md#heartbeat-cadence-and-receipts).
Expand Down
2 changes: 1 addition & 1 deletion i18n/pt-BR/source-hashes.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"polyglot/invocable-carrier.md": "d32d8b5c7c33204b342f977e0af734166d91e96073db1a49ccb4d414a6d67380",
"polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13",
"polyglot/namespace-auth-workers.md": "2b4078ceb74b849f12cb1975b410ff8e7266cd4345f6cf1d4dd906db12460ffb",
"polyglot/php.md": "a13ba8d0c9641a21b6d921e94db5bd1a553c093f41c36d74f107ad8d9fe81e8a",
"polyglot/php.md": "5216eb8f0f37d36e6aee8cc67e4ec97b13a3f48218e7c00a5da3d16c3564bf6f",
"polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989",
"polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959",
"polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c",
Expand Down
Loading
Loading