From 3d778ddd0edb3e8fff2d120a765018b98b77ef77 Mon Sep 17 00:00:00 2001 From: Richard McDaniel <1130888+rmcdaniel@users.noreply.github.com> Date: Sat, 14 Nov 2026 11:21:06 +0000 Subject: [PATCH] Prepare PHP activity identity and idempotency guidance --- docs/constraints/execution-guarantees.md | 11 +++++++++++ docs/polyglot/php.md | 8 ++++++++ .../current/constraints/execution-guarantees.md | 2 ++ .../current/polyglot/php.md | 8 ++++++++ i18n/de/source-hashes.json | 4 ++-- .../current/constraints/execution-guarantees.md | 2 ++ .../current/polyglot/php.md | 8 ++++++++ i18n/es/source-hashes.json | 4 ++-- .../current/constraints/execution-guarantees.md | 2 ++ .../current/polyglot/php.md | 8 ++++++++ i18n/fr/source-hashes.json | 4 ++-- .../current/constraints/execution-guarantees.md | 2 ++ .../current/polyglot/php.md | 8 ++++++++ i18n/ja/source-hashes.json | 4 ++-- .../current/constraints/execution-guarantees.md | 2 ++ .../current/polyglot/php.md | 8 ++++++++ i18n/pt-BR/source-hashes.json | 4 ++-- .../current/constraints/execution-guarantees.md | 2 ++ .../current/polyglot/php.md | 8 ++++++++ i18n/uk/source-hashes.json | 4 ++-- .../current/constraints/execution-guarantees.md | 2 ++ .../current/polyglot/php.md | 8 ++++++++ i18n/zh-Hans/source-hashes.json | 4 ++-- 23 files changed, 103 insertions(+), 14 deletions(-) diff --git a/docs/constraints/execution-guarantees.md b/docs/constraints/execution-guarantees.md index 74dff4ac3cf..0d0aea0b31b 100644 --- a/docs/constraints/execution-guarantees.md +++ b/docs/constraints/execution-guarantees.md @@ -154,6 +154,17 @@ not claim authority, and does not make an external effect exactly once. Keep downstream idempotency, distinct keys for different effects and outcome reconciliation. +PHP service-mode activities expose the read-only nullable +`ActivityContext::activityExecutionId` from the received claim, with `workflowId` +and `runId` for the owning workflow and run. Keep the logical execution ID +across retries. Missing identity stays `null`; a task, attempt or session ID is +not a fallback. The [PHP identity guide](../polyglot/php.md#activity-identity) +links the SDK-owned service-key example and defines absent, session, +historical prepared-local, inline-local and Server-free cases. These accessors +are public metadata, not claim authority. External effects still need +downstream idempotency, distinct keys for different effects and outcome +reconciliation. + ## What Developers Must Make Idempotent You do **not** need to make workflow replay itself idempotent. The framework diff --git a/docs/polyglot/php.md b/docs/polyglot/php.md index 6971bf94327..759f5949a8d 100644 --- a/docs/polyglot/php.md +++ b/docs/polyglot/php.md @@ -163,6 +163,14 @@ Keep signal processing idempotent for the business event. A stable request ID al See the [complete final-attempt and own-run signal examples](https://php.durable-workflow.com/build/workflows-activities/) in the PHP SDK guide. +## Logical activity execution identity {#activity-identity} + +PHP SDK **3.10.0 or later** exposes the read-only nullable `ActivityContext::activityExecutionId` received with an activity claim. It identifies the logical activity across retries. `workflowId` and `runId` identify its owning workflow instance and run; `activityAttemptId` identifies an attempt. Do not substitute a task, attempt or session ID for a missing logical execution ID. + +The SDK preserves the received nonempty string exactly. Omitted, null, empty or non-string identity values produce `null`. Use an application-owned business key when it is unavailable. The [SDK-owned service-key example](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow) shows that fallback; the [property reference](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId) defines the public API. Scope keys to the application and effect, use distinct keys for distinct effects, and reconcile uncertain outcomes with the destination. Identity is public metadata, not claim authority or an exactly-once external-effects guarantee. + +Ordinary and cooperatively supervised remote callbacks read the actual claim field. Session callbacks expose it only when their claim includes it. Inline local and Server-free callbacks without Server admission have `null` execution identity, even when their parent workflow/run IDs are known. Historical prepared-local source forwards its validated admission ID; that source behavior does not establish native prepared-local support. These are source/dataflow boundaries, not installed retry observations for every execution mode. + ## 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). diff --git a/i18n/de/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md b/i18n/de/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md index d7a7727eb80..71034cb1a58 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md @@ -128,6 +128,8 @@ Server belegt nur die Identität bei gewöhnlichen Wiederholungen. Die ID ist nicht Exactly-once. Behalten Sie nachgelagerte Idempotenz, unterschiedliche Schlüssel für verschiedene Effekte und Ergebnisabgleich bei. +PHP-Service-Activities liefern die schreibgeschützte nullable Eigenschaft `ActivityContext::activityExecutionId` aus dem empfangenen Claim sowie `workflowId` und `runId` des besitzenden Workflows und Laufs. Behalten Sie die logische Ausführungs-ID über Wiederholungen hinweg. Fehlende Identität bleibt `null`; eine Task-, Versuchs- oder Session-ID ist kein Fallback. Der [PHP-Identitätsleitfaden](../polyglot/php.md#activity-identity) verlinkt das Service-Key-Beispiel des SDKs und definiert fehlende, Session-, historische Prepared-local-, Inline-local- und Server-freie Fälle. Diese Zugriffswerte sind öffentliche Metadaten, keine Claim-Autorität. Externe Effekte benötigen weiterhin nachgelagerte Idempotenz, getrennte Schlüssel für verschiedene Effekte und Ergebnisabgleich. + ## Was die Anwendung idempotent machen muss {#what-developers-must-make-idempotent} Workflow-Replay selbst müssen Sie nicht idempotent machen. Das Framework rekonstruiert den Zustand aus der festgeschriebenen Historie. diff --git a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/php.md b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/php.md index b71175ca111..7edb7231a79 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/polyglot/php.md +++ b/i18n/de/docusaurus-plugin-content-docs/current/polyglot/php.md @@ -166,6 +166,14 @@ Verarbeiten Sie Signale für das Geschäftsereignis idempotent. Eine stabile Req 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. +## Logische Activity-Ausführungsidentität {#activity-identity} + +PHP SDK **3.10.0 oder neuer** stellt die schreibgeschützte nullable Eigenschaft `ActivityContext::activityExecutionId` aus dem Activity-Claim bereit. Sie identifiziert die logische Activity über Wiederholungen hinweg. `workflowId` und `runId` bezeichnen die besitzende Workflow-Instanz und ihren Lauf; `activityAttemptId` bezeichnet einen Versuch. Ersetzen Sie eine fehlende logische Ausführungs-ID nicht durch eine Task-, Versuchs- oder Session-ID. + +Das SDK erhält die empfangene nichtleere Zeichenfolge exakt. Fehlende, null, leere oder nicht als String empfangene Identitätswerte ergeben `null`. Verwenden Sie dann einen anwendungseigenen Geschäftsschlüssel. Das [Service-Key-Beispiel des SDKs](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow) zeigt diesen Fallback; die [Eigenschaftsreferenz](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId) definiert die öffentliche API. Begrenzen Sie Schlüssel auf Anwendung und Effekt, verwenden Sie verschiedene Schlüssel für verschiedene Effekte und gleichen Sie ungewisse Ergebnisse mit dem Ziel ab. Identität ist öffentliche Metadateninformation, keine Claim-Autorität oder Garantie genau einmal ausgeführter externer Effekte. + +Gewöhnliche und kooperativ überwachte Remote-Callbacks lesen das tatsächliche Claim-Feld. Session-Callbacks liefern es nur, wenn ihr Claim es enthält. Inline-lokale und Server-freie Callbacks ohne Server-Zulassung haben `null` als Ausführungsidentität, auch bei bekannten Eltern-Workflow-/Run-IDs. Historischer Prepared-local-Quellcode reicht seine validierte Zulassungs-ID weiter; dieses Quellverhalten belegt keine native Prepared-local-Unterstützung. Dies sind Quell-/Datenflussgrenzen, keine installierten Retry-Beobachtungen für jeden Ausführungsmodus. + ## 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). diff --git a/i18n/de/source-hashes.json b/i18n/de/source-hashes.json index 7ef1a28e1e1..e93c4a06a01 100644 --- a/i18n/de/source-hashes.json +++ b/i18n/de/source-hashes.json @@ -14,7 +14,7 @@ "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", "constraints/constraints-summary.md": "fb48d01502388fc3821eae3790f470ed29cec91545420450f96fc77b84e589f1", - "constraints/execution-guarantees.md": "9e53840c400b14186587714b32dd54dd780aaa68f2a132fc1e4e4d1f3eeadd0b", + "constraints/execution-guarantees.md": "c5c9dbb3be4a10d115f308bd5b591d56a2a91159228808918d5c0edcf4c88a72", "constraints/idempotent-vs-deterministic.md": "f7396f01a4111ce187e751b009c1efb96f5538e8a602006eed24f7b1d8f44adf", "constraints/overview.md": "fd6c842c6c22d6f0df37a52de15ca74b34664f5ecd78af0c08b1e0cdb9a2be1f", "constraints/structural-limits.md": "5c7b7f6c86c5ca547eb3f200400ceab3b589f32d83866914f44e3a5a7d81e964", @@ -80,7 +80,7 @@ "polyglot/invocable-carrier.md": "00bcf878b7bac1be90718b73f0a626a99cf0e111414ac0854c6491d159798c01", "polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13", "polyglot/namespace-auth-workers.md": "fee5e52a18637814f60aeb419f7ebc99ce4927089dfb748073697a8218bd47bb", - "polyglot/php.md": "7ea69bc61b6a1b8ff9acd141b504128fd6b83ca9522076fe9d971d24a1f70213", + "polyglot/php.md": "2c03a2b9f40167f3ce075677602840b259f0250e410e9780aecb08d41bcc27d9", "polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989", "polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959", "polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c", diff --git a/i18n/es/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md b/i18n/es/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md index 472f9473100..4827285e13b 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md @@ -157,6 +157,8 @@ metadato público, no autoridad del claim, y no hace que un efecto externo ocurr exactamente una vez. Mantenga la idempotencia del destino, claves distintas para efectos diferentes y reconciliación de resultados. +Las actividades PHP en modo servicio exponen `ActivityContext::activityExecutionId`, de solo lectura y nullable, del claim recibido, junto con `workflowId` y `runId` del workflow y ejecución propietarios. Mantenga el ID de ejecución lógica entre reintentos. La identidad ausente permanece `null`; un ID de tarea, intento o sesión no es una alternativa. La [guía de identidad PHP](../polyglot/php.md#activity-identity) enlaza el ejemplo de clave de servicio del SDK y define los casos ausente, sesión, prepared-local histórico, inline-local y sin Server. Estos accesores son metadatos públicos, no autoridad del claim. Los efectos externos siguen necesitando idempotencia en el destino, claves diferentes para efectos diferentes y reconciliación de resultados. + ## Qué debe ser idempotente en tu aplicación {#what-developers-must-make-idempotent} No necesitas hacer idempotente la reproducción del workflow. El framework se diff --git a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/php.md b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/php.md index 0407d1119c2..bc643676703 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/polyglot/php.md +++ b/i18n/es/docusaurus-plugin-content-docs/current/polyglot/php.md @@ -164,6 +164,14 @@ Procese las señales de forma idempotente para el evento de negocio. Un ID de so 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. +## Identidad lógica de ejecución de actividad {#activity-identity} + +PHP SDK **3.10.0 o posterior** expone `ActivityContext::activityExecutionId`, de solo lectura y nullable, recibido con el claim de actividad. Identifica la actividad lógica entre reintentos. `workflowId` y `runId` identifican la instancia y ejecución del workflow propietario; `activityAttemptId` identifica un intento. No sustituya una identidad lógica ausente por un ID de tarea, intento o sesión. + +El SDK conserva exactamente la cadena no vacía recibida. Valores omitidos, null, vacíos o no textuales producen `null`. Use una clave de negocio propia de la aplicación cuando no esté disponible. El [ejemplo de clave de servicio del SDK](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow) muestra esa alternativa; la [referencia de la propiedad](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId) define la API pública. Delimite las claves por aplicación y efecto, use claves distintas para efectos distintos y reconcilie resultados inciertos con el destino. La identidad es metadato público, no autoridad del claim ni garantía de efectos externos exactamente una vez. + +Los callbacks remotos ordinarios y supervisados cooperativamente leen el campo real del claim. Los callbacks de sesión solo lo exponen cuando su claim lo incluye. Los callbacks locales inline y sin Server que carecen de admisión del Server tienen identidad de ejecución `null`, aunque conozcan los IDs del workflow/run padre. El código histórico prepared-local transmite su ID de admisión validado; ese comportamiento de código no acredita soporte prepared-local nativo. Son límites de código/flujo de datos, no observaciones instaladas de reintentos para todos los modos. + ## 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). diff --git a/i18n/es/source-hashes.json b/i18n/es/source-hashes.json index 7ef1a28e1e1..e93c4a06a01 100644 --- a/i18n/es/source-hashes.json +++ b/i18n/es/source-hashes.json @@ -14,7 +14,7 @@ "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", "constraints/constraints-summary.md": "fb48d01502388fc3821eae3790f470ed29cec91545420450f96fc77b84e589f1", - "constraints/execution-guarantees.md": "9e53840c400b14186587714b32dd54dd780aaa68f2a132fc1e4e4d1f3eeadd0b", + "constraints/execution-guarantees.md": "c5c9dbb3be4a10d115f308bd5b591d56a2a91159228808918d5c0edcf4c88a72", "constraints/idempotent-vs-deterministic.md": "f7396f01a4111ce187e751b009c1efb96f5538e8a602006eed24f7b1d8f44adf", "constraints/overview.md": "fd6c842c6c22d6f0df37a52de15ca74b34664f5ecd78af0c08b1e0cdb9a2be1f", "constraints/structural-limits.md": "5c7b7f6c86c5ca547eb3f200400ceab3b589f32d83866914f44e3a5a7d81e964", @@ -80,7 +80,7 @@ "polyglot/invocable-carrier.md": "00bcf878b7bac1be90718b73f0a626a99cf0e111414ac0854c6491d159798c01", "polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13", "polyglot/namespace-auth-workers.md": "fee5e52a18637814f60aeb419f7ebc99ce4927089dfb748073697a8218bd47bb", - "polyglot/php.md": "7ea69bc61b6a1b8ff9acd141b504128fd6b83ca9522076fe9d971d24a1f70213", + "polyglot/php.md": "2c03a2b9f40167f3ce075677602840b259f0250e410e9780aecb08d41bcc27d9", "polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989", "polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959", "polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c", diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md b/i18n/fr/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md index 00671feb27c..b9f7dfb653c 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md @@ -128,6 +128,8 @@ une métadonnée publique, pas une autorité de claim, et ne garantit pas qu’u effet externe se produise exactement une fois. Conservez l’idempotence du destinataire, des clés distinctes pour des effets différents et la réconciliation des résultats. +Les activités PHP en mode service exposent `ActivityContext::activityExecutionId`, nullable et en lecture seule, issu du claim reçu, avec `workflowId` et `runId` du workflow et de l’exécution propriétaires. Conservez l’ID logique d’exécution entre tentatives. L’identité absente reste `null` ; un ID de tâche, tentative ou session n’est pas un repli. Le [guide d’identité PHP](../polyglot/php.md#activity-identity) lie l’exemple de clé de service du SDK et définit les cas absent, session, prepared-local historique, inline-local et sans Server. Ces accesseurs sont des métadonnées publiques, pas une autorité de claim. Les effets externes nécessitent toujours idempotence à destination, clés distinctes pour des effets distincts et réconciliation des résultats. + ## Effets que l’application doit rendre idempotents {#what-developers-must-make-idempotent} Vous n’avez pas besoin de rendre la relecture du workflow elle-même idempotente. Le framework gère la relecture en reconstruisant l’état depuis l’historique validé. diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/php.md b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/php.md index 8cc1c3bdc36..88e5637b995 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/php.md +++ b/i18n/fr/docusaurus-plugin-content-docs/current/polyglot/php.md @@ -169,6 +169,14 @@ Traitez les signaux de manière idempotente pour l’événement métier. Un ide 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. +## Identité logique d’exécution d’activité {#activity-identity} + +PHP SDK **3.10.0 ou ultérieur** expose `ActivityContext::activityExecutionId`, nullable et en lecture seule, reçu avec le claim d’activité. Il identifie l’activité logique entre tentatives. `workflowId` et `runId` identifient l’instance et l’exécution du workflow propriétaire ; `activityAttemptId` identifie une tentative. Ne remplacez pas une identité logique absente par un ID de tâche, tentative ou session. + +Le SDK conserve exactement la chaîne non vide reçue. Une identité omise, null, vide ou qui n’est pas une chaîne produit `null`. Utilisez alors une clé métier appartenant à l’application. L’[exemple de clé de service du SDK](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow) montre ce repli ; la [référence de la propriété](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId) définit l’API publique. Délimitez les clés par application et effet, utilisez des clés distinctes pour des effets distincts et réconciliez les résultats incertains avec la destination. L’identité est une métadonnée publique, pas une autorité de claim ni une garantie d’effets externes exactement une fois. + +Les callbacks distants ordinaires et supervisés coopérativement lisent le champ réel du claim. Les callbacks de session ne l’exposent que si leur claim le contient. Les callbacks locaux inline et sans Server dépourvus d’admission Server ont une identité d’exécution `null`, même lorsque les IDs du workflow/run parent sont connus. Le code historique prepared-local transmet son ID d’admission validé ; ce comportement source n’établit pas un support prepared-local natif. Ce sont des limites de code/flux de données, pas des observations installées de nouvelles tentatives dans chaque mode. + ## 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). diff --git a/i18n/fr/source-hashes.json b/i18n/fr/source-hashes.json index 7ef1a28e1e1..e93c4a06a01 100644 --- a/i18n/fr/source-hashes.json +++ b/i18n/fr/source-hashes.json @@ -14,7 +14,7 @@ "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", "constraints/constraints-summary.md": "fb48d01502388fc3821eae3790f470ed29cec91545420450f96fc77b84e589f1", - "constraints/execution-guarantees.md": "9e53840c400b14186587714b32dd54dd780aaa68f2a132fc1e4e4d1f3eeadd0b", + "constraints/execution-guarantees.md": "c5c9dbb3be4a10d115f308bd5b591d56a2a91159228808918d5c0edcf4c88a72", "constraints/idempotent-vs-deterministic.md": "f7396f01a4111ce187e751b009c1efb96f5538e8a602006eed24f7b1d8f44adf", "constraints/overview.md": "fd6c842c6c22d6f0df37a52de15ca74b34664f5ecd78af0c08b1e0cdb9a2be1f", "constraints/structural-limits.md": "5c7b7f6c86c5ca547eb3f200400ceab3b589f32d83866914f44e3a5a7d81e964", @@ -80,7 +80,7 @@ "polyglot/invocable-carrier.md": "00bcf878b7bac1be90718b73f0a626a99cf0e111414ac0854c6491d159798c01", "polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13", "polyglot/namespace-auth-workers.md": "fee5e52a18637814f60aeb419f7ebc99ce4927089dfb748073697a8218bd47bb", - "polyglot/php.md": "7ea69bc61b6a1b8ff9acd141b504128fd6b83ca9522076fe9d971d24a1f70213", + "polyglot/php.md": "2c03a2b9f40167f3ce075677602840b259f0250e410e9780aecb08d41bcc27d9", "polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989", "polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959", "polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c", diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md b/i18n/ja/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md index df414a9adec..755e7d937d2 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md @@ -126,6 +126,8 @@ ID だけです。ID は公開メタデータであり claim の権限ではな 厳密に 1 回にするものでもありません。外部サービスの冪等性、異なる副作用ごとの 別々のキー、結果の照合を維持してください。 +PHP サービスモードのアクティビティは、受信 claim の読み取り専用で nullable な `ActivityContext::activityExecutionId` と、所有ワークフローと実行の `workflowId`、`runId` を公開します。リトライを通じて論理実行 ID を保ってください。ID がなければ `null` のままで、タスク、試行、セッションの ID は代わりになりません。[PHP ID ガイド](../polyglot/php.md#activity-identity)は SDK のサービスキー例にリンクし、ID 不在、セッション、過去の prepared-local、inline-local、Server-free の場合を定義します。アクセサーは公開メタデータであり、claim の権限ではありません。外部効果には引き続き宛先での冪等性、効果ごとに異なるキー、結果の照合が必要です。 + ## 開発者が冪等にする処理 {#what-developers-must-make-idempotent} ワークフローのリプレイ自体を冪等にする必要はありません。フレームワークが確定済み履歴から状態を再構築して処理します。 diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/php.md b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/php.md index 5d71d13fc83..5d1d7bdcb56 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/php.md +++ b/i18n/ja/docusaurus-plugin-content-docs/current/polyglot/php.md @@ -101,6 +101,14 @@ PHP SDK **3.6.1 以降**では、サービスモードのアクティビティ PHP SDK ガイドの[最終試行の判定と自身の実行へのシグナル送信の完全な例](https://php.durable-workflow.com/build/workflows-activities/)を参照してください。 +## アクティビティの論理実行 ID {#activity-identity} + +PHP SDK **3.10.0 以降**は、アクティビティ claim で受け取った読み取り専用の nullable な `ActivityContext::activityExecutionId` を公開します。リトライを通じた論理アクティビティを識別します。`workflowId` と `runId` は所有ワークフローのインスタンスと実行を、`activityAttemptId` は試行を識別します。論理実行 ID がない場合、タスク、試行、セッションの ID で代用しないでください。 + +SDK は受信した空でない文字列をそのまま保持します。省略、null、空文字列、文字列以外の値は `null` になります。使えない場合はアプリケーションが管理するビジネスキーを使います。[SDK のサービスキー例](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow)にフォールバックを、[プロパティリファレンス](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId)に公開 API を示しています。キーをアプリケーションと効果の範囲に限定し、異なる効果には異なるキーを使い、不確かな結果を宛先と照合してください。ID は公開メタデータであり、claim の権限や外部効果の厳密な一度限りの保証ではありません。 + +通常のリモート callback と協調監視されるリモート callback は実際の claim フィールドを読みます。セッション callback は claim に含まれる場合だけ公開します。Server の admission がない inline-local と Server-free callback の実行 ID は、親 workflow/run ID が既知でも `null` です。過去の prepared-local ソースは検証済み admission ID を渡しますが、そのソース動作は native prepared-local 対応を示しません。これらはソースとデータフローの境界であり、全モードでインストール済み環境のリトライを観測した結果ではありません。 + ## アクティビティのハートビート {#activity-heartbeats} リモートアクティビティでは、上限を設けた処理の途中で、設定されたハートビートのタイムアウトより十分前に `ActivityContext::heartbeat($details)` を呼び出します。最初の期間はランタイムのタスク取得から始まり、PHP がタスクを受信した時点からではありません。リクエストの遅延、中断、通信の再試行も期間を消費します。[送信間隔の指針](../features/heartbeats.md#heartbeat-cadence-and-receipts)に従ってください。 diff --git a/i18n/ja/source-hashes.json b/i18n/ja/source-hashes.json index 7ef1a28e1e1..e93c4a06a01 100644 --- a/i18n/ja/source-hashes.json +++ b/i18n/ja/source-hashes.json @@ -14,7 +14,7 @@ "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", "constraints/constraints-summary.md": "fb48d01502388fc3821eae3790f470ed29cec91545420450f96fc77b84e589f1", - "constraints/execution-guarantees.md": "9e53840c400b14186587714b32dd54dd780aaa68f2a132fc1e4e4d1f3eeadd0b", + "constraints/execution-guarantees.md": "c5c9dbb3be4a10d115f308bd5b591d56a2a91159228808918d5c0edcf4c88a72", "constraints/idempotent-vs-deterministic.md": "f7396f01a4111ce187e751b009c1efb96f5538e8a602006eed24f7b1d8f44adf", "constraints/overview.md": "fd6c842c6c22d6f0df37a52de15ca74b34664f5ecd78af0c08b1e0cdb9a2be1f", "constraints/structural-limits.md": "5c7b7f6c86c5ca547eb3f200400ceab3b589f32d83866914f44e3a5a7d81e964", @@ -80,7 +80,7 @@ "polyglot/invocable-carrier.md": "00bcf878b7bac1be90718b73f0a626a99cf0e111414ac0854c6491d159798c01", "polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13", "polyglot/namespace-auth-workers.md": "fee5e52a18637814f60aeb419f7ebc99ce4927089dfb748073697a8218bd47bb", - "polyglot/php.md": "7ea69bc61b6a1b8ff9acd141b504128fd6b83ca9522076fe9d971d24a1f70213", + "polyglot/php.md": "2c03a2b9f40167f3ce075677602840b259f0250e410e9780aecb08d41bcc27d9", "polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989", "polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959", "polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c", diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md index 880bd467faa..1b3653b5f95 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md @@ -128,6 +128,8 @@ público, não autoridade do claim, e não faz um efeito externo ocorrer exatamente uma vez. Mantenha a idempotência do destino, chaves distintas para efeitos diferentes e reconciliação de resultados. +Atividades PHP em modo serviço expõem `ActivityContext::activityExecutionId`, somente leitura e nullable, a partir do claim recebido, com `workflowId` e `runId` do workflow e execução proprietários. Mantenha o ID lógico de execução entre tentativas. Identidade ausente permanece `null`; um ID de tarefa, tentativa ou sessão não é fallback. O [guia de identidade PHP](../polyglot/php.md#activity-identity) vincula o exemplo de chave de serviço do SDK e define os casos ausente, sessão, prepared-local histórico, inline-local e sem Server. Esses acessores são metadados públicos, não autoridade do claim. Efeitos externos continuam exigindo idempotência no destino, chaves distintas para efeitos distintos e reconciliação de resultados. + ## O que a aplicação precisa tornar idempotente {#what-developers-must-make-idempotent} Você **não** precisa tornar o próprio replay idempotente. O framework reconstrói o estado a partir do histórico confirmado. diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/php.md b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/php.md index 5cbd58094af..6a945bdafa5 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/php.md +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current/polyglot/php.md @@ -168,6 +168,14 @@ Processe os sinais de forma idempotente para o evento de negócio. Um ID de requ 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. +## Identidade lógica de execução de atividade {#activity-identity} + +PHP SDK **3.10.0 ou posterior** expõe `ActivityContext::activityExecutionId`, somente leitura e nullable, recebido no claim da atividade. Ele identifica a atividade lógica entre tentativas. `workflowId` e `runId` identificam a instância e a execução do workflow proprietário; `activityAttemptId` identifica uma tentativa. Não substitua uma identidade lógica ausente por um ID de tarefa, tentativa ou sessão. + +O SDK preserva exatamente a string não vazia recebida. Valores omitidos, null, vazios ou que não sejam strings produzem `null`. Use uma chave de negócio da aplicação quando ela não estiver disponível. O [exemplo de chave de serviço do SDK](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow) mostra esse fallback; a [referência da propriedade](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId) define a API pública. Delimite as chaves por aplicação e efeito, use chaves distintas para efeitos distintos e reconcilie resultados incertos com o destino. A identidade é metadado público, não autoridade do claim nem garantia de efeitos externos exatamente uma vez. + +Callbacks remotos comuns e supervisionados cooperativamente leem o campo real do claim. Callbacks de sessão só o expõem quando o claim o inclui. Callbacks locais inline e sem Server que não tenham admissão do Server têm identidade de execução `null`, mesmo quando os IDs do workflow/run pai são conhecidos. O código histórico prepared-local encaminha o ID de admissão validado; esse comportamento de código não comprova suporte prepared-local nativo. São limites de código/fluxo de dados, não observações instaladas de novas tentativas em todos os modos. + ## 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). diff --git a/i18n/pt-BR/source-hashes.json b/i18n/pt-BR/source-hashes.json index 7ef1a28e1e1..e93c4a06a01 100644 --- a/i18n/pt-BR/source-hashes.json +++ b/i18n/pt-BR/source-hashes.json @@ -14,7 +14,7 @@ "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", "constraints/constraints-summary.md": "fb48d01502388fc3821eae3790f470ed29cec91545420450f96fc77b84e589f1", - "constraints/execution-guarantees.md": "9e53840c400b14186587714b32dd54dd780aaa68f2a132fc1e4e4d1f3eeadd0b", + "constraints/execution-guarantees.md": "c5c9dbb3be4a10d115f308bd5b591d56a2a91159228808918d5c0edcf4c88a72", "constraints/idempotent-vs-deterministic.md": "f7396f01a4111ce187e751b009c1efb96f5538e8a602006eed24f7b1d8f44adf", "constraints/overview.md": "fd6c842c6c22d6f0df37a52de15ca74b34664f5ecd78af0c08b1e0cdb9a2be1f", "constraints/structural-limits.md": "5c7b7f6c86c5ca547eb3f200400ceab3b589f32d83866914f44e3a5a7d81e964", @@ -80,7 +80,7 @@ "polyglot/invocable-carrier.md": "00bcf878b7bac1be90718b73f0a626a99cf0e111414ac0854c6491d159798c01", "polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13", "polyglot/namespace-auth-workers.md": "fee5e52a18637814f60aeb419f7ebc99ce4927089dfb748073697a8218bd47bb", - "polyglot/php.md": "7ea69bc61b6a1b8ff9acd141b504128fd6b83ca9522076fe9d971d24a1f70213", + "polyglot/php.md": "2c03a2b9f40167f3ce075677602840b259f0250e410e9780aecb08d41bcc27d9", "polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989", "polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959", "polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c", diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md b/i18n/uk/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md index 9c19440827d..ce4e9356171 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md @@ -155,6 +155,8 @@ activity inline та контекстів без Server. Його квитанц зовнішній ефект рівно один раз. Зберігайте ідемпотентність зовнішнього сервісу, різні ключі для різних ефектів та узгодження результатів. +PHP activity у service-mode надають nullable властивість лише для читання `ActivityContext::activityExecutionId` з отриманого claim, а також `workflowId` і `runId` workflow та запуску-власника. Зберігайте логічний ID виконання між повторними спробами. Відсутня ідентичність залишається `null`; ID завдання, спроби чи сесії не є fallback. [PHP-довідник ідентичності](../polyglot/php.md#activity-identity) посилається на SDK-приклад service key і визначає випадки відсутності, сесії, історичного prepared-local, inline-local та Server-free. Ці accessor-и є публічними метаданими, не повноваженням claim. Зовнішні ефекти й далі потребують ідемпотентності цільової системи, окремих ключів для різних ефектів і звіряння результатів. + ## Що розробники мають зробити ідемпотентним {#what-developers-must-make-idempotent} Вам **не** потрібно робити саме відтворення workflow ідемпотентним. Фреймворк diff --git a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/php.md b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/php.md index a8d4f5e0e5a..294f968f838 100644 --- a/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/php.md +++ b/i18n/uk/docusaurus-plugin-content-docs/current/polyglot/php.md @@ -166,6 +166,14 @@ PHP SDK **3.6.1 або новіший** надає `$context->retryInfo`, `$cont Дивіться [повні приклади перевірки останньої спроби та сигналу власному запуску](https://php.durable-workflow.com/build/workflows-activities/) у посібнику PHP SDK. +## Логічна ідентичність виконання activity {#activity-identity} + +PHP SDK **3.10.0 або новіший** надає nullable властивість лише для читання `ActivityContext::activityExecutionId`, отриману з activity claim. Вона ідентифікує логічну activity між повторними спробами. `workflowId` і `runId` позначають екземпляр і запуск workflow-власника; `activityAttemptId` позначає спробу. Не підставляйте ID завдання, спроби чи сесії замість відсутньої логічної ідентичності. + +SDK точно зберігає отриманий непорожній рядок. Пропущені, null, порожні або не-рядкові значення ідентичності дають `null`. Якщо вона недоступна, використовуйте бізнес-ключ застосунку. [Приклад service key від SDK](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow) показує цей fallback; [довідник властивості](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId) визначає публічний API. Обмежуйте ключі застосунком та ефектом, беріть різні ключі для різних ефектів і звіряйте невизначені результати з цільовою системою. Ідентичність є публічними метаданими, а не повноваженням claim чи гарантією зовнішніх ефектів рівно один раз. + +Звичайні й кооперативно контрольовані віддалені callbacks читають фактичне поле claim. Сесійні callbacks надають його лише за наявності в їхньому claim. Inline-local і Server-free callbacks без Server admission мають ідентичність виконання `null`, навіть коли ID батьківського workflow/run відомі. Історичний prepared-local код передає перевірений admission ID; така поведінка коду не встановлює підтримку native prepared-local. Це межі коду/потоку даних, а не встановлені спостереження повторних спроб у кожному режимі. + ## Heartbeat activity {#activity-heartbeats} Для віддалених activities викликайте `ActivityContext::heartbeat($details)` під час обмеженої роботи activity, задовго до налаштованого тайм-ауту heartbeat. Перше вікно починається, коли runtime отримує повноваження на завдання, а не коли PHP отримує його. Затримки запитів, паузи й транспортні повтори витрачають це вікно. Дотримуйтеся [порад щодо періодичності](../features/heartbeats.md#heartbeat-cadence-and-receipts). diff --git a/i18n/uk/source-hashes.json b/i18n/uk/source-hashes.json index 7ef1a28e1e1..e93c4a06a01 100644 --- a/i18n/uk/source-hashes.json +++ b/i18n/uk/source-hashes.json @@ -14,7 +14,7 @@ "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", "constraints/constraints-summary.md": "fb48d01502388fc3821eae3790f470ed29cec91545420450f96fc77b84e589f1", - "constraints/execution-guarantees.md": "9e53840c400b14186587714b32dd54dd780aaa68f2a132fc1e4e4d1f3eeadd0b", + "constraints/execution-guarantees.md": "c5c9dbb3be4a10d115f308bd5b591d56a2a91159228808918d5c0edcf4c88a72", "constraints/idempotent-vs-deterministic.md": "f7396f01a4111ce187e751b009c1efb96f5538e8a602006eed24f7b1d8f44adf", "constraints/overview.md": "fd6c842c6c22d6f0df37a52de15ca74b34664f5ecd78af0c08b1e0cdb9a2be1f", "constraints/structural-limits.md": "5c7b7f6c86c5ca547eb3f200400ceab3b589f32d83866914f44e3a5a7d81e964", @@ -80,7 +80,7 @@ "polyglot/invocable-carrier.md": "00bcf878b7bac1be90718b73f0a626a99cf0e111414ac0854c6491d159798c01", "polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13", "polyglot/namespace-auth-workers.md": "fee5e52a18637814f60aeb419f7ebc99ce4927089dfb748073697a8218bd47bb", - "polyglot/php.md": "7ea69bc61b6a1b8ff9acd141b504128fd6b83ca9522076fe9d971d24a1f70213", + "polyglot/php.md": "2c03a2b9f40167f3ce075677602840b259f0250e410e9780aecb08d41bcc27d9", "polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989", "polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959", "polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c", diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md index 714de1dd260..f7984ba634a 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/constraints/execution-guarantees.md @@ -123,6 +123,8 @@ Python 服务模式活动提供只读的可选字段 不是 claim 权限,也不会使外部副作用恰好发生一次。请保留下游幂等性、不同副作用使用 不同键,以及结果对账。 +PHP 服务模式活动提供来自收到的领取的只读可空 `ActivityContext::activityExecutionId`,以及所属工作流和运行的 `workflowId`、`runId`。请在重试间保持逻辑执行 ID。缺失的标识保持 `null`;任务、尝试或会话 ID 不能作为回退。[PHP 标识指南](../polyglot/php.md#activity-identity)链接 SDK 服务键示例,并定义缺失、会话、历史 prepared-local、inline-local 和 Server-free 情况。这些访问器是公开元数据,不是领取权限。外部副作用仍需要目标系统的幂等性、不同副作用的不同键和结果核对。 + ## 开发者需要保证哪些操作幂等 {#what-developers-must-make-idempotent} 你无需让工作流重放本身具有幂等性。框架通过已提交历史重建状态,负责处理重放。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/php.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/php.md index 940f55e598c..989a963e367 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/php.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/polyglot/php.md @@ -101,6 +101,14 @@ PHP SDK **3.6.1 及以上版本**在服务模式活动中提供 `$context->retry 请参阅 PHP SDK 指南中的[最后一次尝试检查与向自身运行发送信号的完整示例](https://php.durable-workflow.com/build/workflows-activities/)。 +## 活动的逻辑执行标识 {#activity-identity} + +PHP SDK **3.10.0 或更新版本**提供从活动领取中收到的只读可空 `ActivityContext::activityExecutionId`。它标识跨重试的逻辑活动。`workflowId` 和 `runId` 标识所属工作流实例和运行;`activityAttemptId` 标识一次尝试。不要用任务、尝试或会话 ID 替代缺失的逻辑执行 ID。 + +SDK 原样保留收到的非空字符串。省略、null、空字符串或非字符串标识值会产生 `null`。不可用时请使用应用自有的业务键。[SDK 服务键示例](https://php.durable-workflow.com/build/workflows-activities/#inspect-retry-budget-and-the-owning-workflow)展示了回退方式;[属性参考](https://php.durable-workflow.com/api/classes/DurableWorkflow-Worker-ActivityContext.html#property_activityExecutionId)定义了公开 API。按应用和副作用限定键,为不同副作用使用不同键,并与目标系统核对不确定结果。标识是公开元数据,不是领取权限,也不保证外部副作用恰好执行一次。 + +普通远程回调和协作式监督远程回调读取实际领取字段。会话回调仅在其领取包含该字段时提供它。没有 Server 准入的 inline-local 和 Server-free 回调具有 `null` 执行标识,即使已知父工作流/run ID。历史 prepared-local 源码传递经过验证的准入 ID;这种源码行为不代表支持原生 prepared-local。这些是源码和数据流边界,不是所有执行模式下已安装环境的重试观察结果。 + ## 活动心跳 {#activity-heartbeats} 对于远程活动,在有界工作期间调用 `ActivityContext::heartbeat($details)`,并在配置的心跳超时到期前留足时间。第一个窗口从运行时领取任务开始,而不是 PHP 收到任务时开始。请求延迟、暂停和传输重试都会消耗该窗口。请遵循[发送节奏建议](../features/heartbeats.md#heartbeat-cadence-and-receipts)。 diff --git a/i18n/zh-Hans/source-hashes.json b/i18n/zh-Hans/source-hashes.json index 7ef1a28e1e1..e93c4a06a01 100644 --- a/i18n/zh-Hans/source-hashes.json +++ b/i18n/zh-Hans/source-hashes.json @@ -14,7 +14,7 @@ "configuration/publishing-config.md": "c757acd749c0d2696a6e19484249c9298dd15970ce0cf2ae0e6d2dfd82c8b6d6", "constraints/activity-constraints.md": "5a953d0e95e750b6c02d1c72b72199fb3ff4687540cebc56aa3b216cf667bb05", "constraints/constraints-summary.md": "fb48d01502388fc3821eae3790f470ed29cec91545420450f96fc77b84e589f1", - "constraints/execution-guarantees.md": "9e53840c400b14186587714b32dd54dd780aaa68f2a132fc1e4e4d1f3eeadd0b", + "constraints/execution-guarantees.md": "c5c9dbb3be4a10d115f308bd5b591d56a2a91159228808918d5c0edcf4c88a72", "constraints/idempotent-vs-deterministic.md": "f7396f01a4111ce187e751b009c1efb96f5538e8a602006eed24f7b1d8f44adf", "constraints/overview.md": "fd6c842c6c22d6f0df37a52de15ca74b34664f5ecd78af0c08b1e0cdb9a2be1f", "constraints/structural-limits.md": "5c7b7f6c86c5ca547eb3f200400ceab3b589f32d83866914f44e3a5a7d81e964", @@ -80,7 +80,7 @@ "polyglot/invocable-carrier.md": "00bcf878b7bac1be90718b73f0a626a99cf0e111414ac0854c6491d159798c01", "polyglot/invocable-php-handler.md": "3b678eb1d69fe32dfcfdc05d36b33e49e01b79d7216bd784f6a61a6f1c3c3a13", "polyglot/namespace-auth-workers.md": "fee5e52a18637814f60aeb419f7ebc99ce4927089dfb748073697a8218bd47bb", - "polyglot/php.md": "7ea69bc61b6a1b8ff9acd141b504128fd6b83ca9522076fe9d971d24a1f70213", + "polyglot/php.md": "2c03a2b9f40167f3ce075677602840b259f0250e410e9780aecb08d41bcc27d9", "polyglot/polling-patterns.md": "30875099a23731c6c471b481a771378acc6ff57eed2fda4405a509057534c989", "polyglot/portable-worker-affinity.md": "40973c6a31a76845b4f95e9a505e68ad76abd5174bbdccf37993cdebc8904959", "polyglot/prerelease-history-migration.md": "a57f05f492228a8a67791f9152648a1e5f80856325b78777cf63b6ef49b7413c",