diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index 9c2c295f0..0fbb6d2ec 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -10,7 +10,7 @@
},
"ghcr.io/devcontainers/features/hugo:1": {
"extended": true,
- "version": "latest"
+ "version": "0.100.2"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
diff --git a/.github/workflows/stale-pr-monitor.yml b/.github/workflows/stale-pr-monitor.yml
index ee56977ab..44f106127 100644
--- a/.github/workflows/stale-pr-monitor.yml
+++ b/.github/workflows/stale-pr-monitor.yml
@@ -18,4 +18,4 @@ jobs:
stale-pr-message: 'Stale PR, paging all reviewers'
stale-pr-label: 'stale'
exempt-pr-labels: 'question,"help wanted",do-not-merge,waiting-on-code-pr'
- days-before-stale: 5
+ days-before-stale: 90
diff --git a/LICENSE b/LICENSE
index 4ea99c213..edffc98ff 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,395 +1,204 @@
-Attribution 4.0 International
-
-=======================================================================
-
-Creative Commons Corporation ("Creative Commons") is not a law firm and
-does not provide legal services or legal advice. Distribution of
-Creative Commons public licenses does not create a lawyer-client or
-other relationship. Creative Commons makes its licenses and related
-information available on an "as-is" basis. Creative Commons gives no
-warranties regarding its licenses, any material licensed under their
-terms and conditions, or any related information. Creative Commons
-disclaims all liability for damages resulting from their use to the
-fullest extent possible.
-
-Using Creative Commons Public Licenses
-
-Creative Commons public licenses provide a standard set of terms and
-conditions that creators and other rights holders may use to share
-original works of authorship and other material subject to copyright
-and certain other rights specified in the public license below. The
-following considerations are for informational purposes only, are not
-exhaustive, and do not form part of our licenses.
-
- Considerations for licensors: Our public licenses are
- intended for use by those authorized to give the public
- permission to use material in ways otherwise restricted by
- copyright and certain other rights. Our licenses are
- irrevocable. Licensors should read and understand the terms
- and conditions of the license they choose before applying it.
- Licensors should also secure all rights necessary before
- applying our licenses so that the public can reuse the
- material as expected. Licensors should clearly mark any
- material not subject to the license. This includes other CC-
- licensed material, or material used under an exception or
- limitation to copyright. More considerations for licensors:
- wiki.creativecommons.org/Considerations_for_licensors
-
- Considerations for the public: By using one of our public
- licenses, a licensor grants the public permission to use the
- licensed material under specified terms and conditions. If
- the licensor's permission is not necessary for any reason--for
- example, because of any applicable exception or limitation to
- copyright--then that use is not regulated by the license. Our
- licenses grant only permissions under copyright and certain
- other rights that a licensor has authority to grant. Use of
- the licensed material may still be restricted for other
- reasons, including because others have copyright or other
- rights in the material. A licensor may make special requests,
- such as asking that all changes be marked or described.
- Although not required by our licenses, you are encouraged to
- respect those requests where reasonable. More considerations
- for the public:
- wiki.creativecommons.org/Considerations_for_licensees
-
-=======================================================================
-
-Creative Commons Attribution 4.0 International Public License
-
-By exercising the Licensed Rights (defined below), You accept and agree
-to be bound by the terms and conditions of this Creative Commons
-Attribution 4.0 International Public License ("Public License"). To the
-extent this Public License may be interpreted as a contract, You are
-granted the Licensed Rights in consideration of Your acceptance of
-these terms and conditions, and the Licensor grants You such rights in
-consideration of benefits the Licensor receives from making the
-Licensed Material available under these terms and conditions.
-
-
-Section 1 -- Definitions.
-
- a. Adapted Material means material subject to Copyright and Similar
- Rights that is derived from or based upon the Licensed Material
- and in which the Licensed Material is translated, altered,
- arranged, transformed, or otherwise modified in a manner requiring
- permission under the Copyright and Similar Rights held by the
- Licensor. For purposes of this Public License, where the Licensed
- Material is a musical work, performance, or sound recording,
- Adapted Material is always produced where the Licensed Material is
- synched in timed relation with a moving image.
-
- b. Adapter's License means the license You apply to Your Copyright
- and Similar Rights in Your contributions to Adapted Material in
- accordance with the terms and conditions of this Public License.
-
- c. Copyright and Similar Rights means copyright and/or similar rights
- closely related to copyright including, without limitation,
- performance, broadcast, sound recording, and Sui Generis Database
- Rights, without regard to how the rights are labeled or
- categorized. For purposes of this Public License, the rights
- specified in Section 2(b)(1)-(2) are not Copyright and Similar
- Rights.
-
- d. Effective Technological Measures means those measures that, in the
- absence of proper authority, may not be circumvented under laws
- fulfilling obligations under Article 11 of the WIPO Copyright
- Treaty adopted on December 20, 1996, and/or similar international
- agreements.
-
- e. Exceptions and Limitations means fair use, fair dealing, and/or
- any other exception or limitation to Copyright and Similar Rights
- that applies to Your use of the Licensed Material.
-
- f. Licensed Material means the artistic or literary work, database,
- or other material to which the Licensor applied this Public
- License.
-
- g. Licensed Rights means the rights granted to You subject to the
- terms and conditions of this Public License, which are limited to
- all Copyright and Similar Rights that apply to Your use of the
- Licensed Material and that the Licensor has authority to license.
-
- h. Licensor means the individual(s) or entity(ies) granting rights
- under this Public License.
-
- i. Share means to provide material to the public by any means or
- process that requires permission under the Licensed Rights, such
- as reproduction, public display, public performance, distribution,
- dissemination, communication, or importation, and to make material
- available to the public including in ways that members of the
- public may access the material from a place and at a time
- individually chosen by them.
-
- j. Sui Generis Database Rights means rights other than copyright
- resulting from Directive 96/9/EC of the European Parliament and of
- the Council of 11 March 1996 on the legal protection of databases,
- as amended and/or succeeded, as well as other essentially
- equivalent rights anywhere in the world.
-
- k. You means the individual or entity exercising the Licensed Rights
- under this Public License. Your has a corresponding meaning.
-
-
-Section 2 -- Scope.
-
- a. License grant.
-
- 1. Subject to the terms and conditions of this Public License,
- the Licensor hereby grants You a worldwide, royalty-free,
- non-sublicensable, non-exclusive, irrevocable license to
- exercise the Licensed Rights in the Licensed Material to:
-
- a. reproduce and Share the Licensed Material, in whole or
- in part; and
-
- b. produce, reproduce, and Share Adapted Material.
-
- 2. Exceptions and Limitations. For the avoidance of doubt, where
- Exceptions and Limitations apply to Your use, this Public
- License does not apply, and You do not need to comply with
- its terms and conditions.
-
- 3. Term. The term of this Public License is specified in Section
- 6(a).
-
- 4. Media and formats; technical modifications allowed. The
- Licensor authorizes You to exercise the Licensed Rights in
- all media and formats whether now known or hereafter created,
- and to make technical modifications necessary to do so. The
- Licensor waives and/or agrees not to assert any right or
- authority to forbid You from making technical modifications
- necessary to exercise the Licensed Rights, including
- technical modifications necessary to circumvent Effective
- Technological Measures. For purposes of this Public License,
- simply making modifications authorized by this Section 2(a)
- (4) never produces Adapted Material.
- 5. Downstream recipients.
-
- a. Offer from the Licensor -- Licensed Material. Every
- recipient of the Licensed Material automatically
- receives an offer from the Licensor to exercise the
- Licensed Rights under the terms and conditions of this
- Public License.
-
- b. No downstream restrictions. You may not offer or impose
- any additional or different terms or conditions on, or
- apply any Effective Technological Measures to, the
- Licensed Material if doing so restricts exercise of the
- Licensed Rights by any recipient of the Licensed
- Material.
-
- 6. No endorsement. Nothing in this Public License constitutes or
- may be construed as permission to assert or imply that You
- are, or that Your use of the Licensed Material is, connected
- with, or sponsored, endorsed, or granted official status by,
- the Licensor or others designated to receive attribution as
- provided in Section 3(a)(1)(A)(i).
-
- b. Other rights.
-
- 1. Moral rights, such as the right of integrity, are not
- licensed under this Public License, nor are publicity,
- privacy, and/or other similar personality rights; however, to
- the extent possible, the Licensor waives and/or agrees not to
- assert any such rights held by the Licensor to the limited
- extent necessary to allow You to exercise the Licensed
- Rights, but not otherwise.
-
- 2. Patent and trademark rights are not licensed under this
- Public License.
-
- 3. To the extent possible, the Licensor waives any right to
- collect royalties from You for the exercise of the Licensed
- Rights, whether directly or through a collecting society
- under any voluntary or waivable statutory or compulsory
- licensing scheme. In all other cases the Licensor expressly
- reserves any right to collect such royalties.
-
-
-Section 3 -- License Conditions.
-
-Your exercise of the Licensed Rights is expressly made subject to the
-following conditions.
-
- a. Attribution.
-
- 1. If You Share the Licensed Material (including in modified
- form), You must:
-
- a. retain the following if it is supplied by the Licensor
- with the Licensed Material:
-
- i. identification of the creator(s) of the Licensed
- Material and any others designated to receive
- attribution, in any reasonable manner requested by
- the Licensor (including by pseudonym if
- designated);
-
- ii. a copyright notice;
-
- iii. a notice that refers to this Public License;
-
- iv. a notice that refers to the disclaimer of
- warranties;
-
- v. a URI or hyperlink to the Licensed Material to the
- extent reasonably practicable;
-
- b. indicate if You modified the Licensed Material and
- retain an indication of any previous modifications; and
-
- c. indicate the Licensed Material is licensed under this
- Public License, and include the text of, or the URI or
- hyperlink to, this Public License.
-
- 2. You may satisfy the conditions in Section 3(a)(1) in any
- reasonable manner based on the medium, means, and context in
- which You Share the Licensed Material. For example, it may be
- reasonable to satisfy the conditions by providing a URI or
- hyperlink to a resource that includes the required
- information.
-
- 3. If requested by the Licensor, You must remove any of the
- information required by Section 3(a)(1)(A) to the extent
- reasonably practicable.
-
- 4. If You Share Adapted Material You produce, the Adapter's
- License You apply must not prevent recipients of the Adapted
- Material from complying with this Public License.
-
-
-Section 4 -- Sui Generis Database Rights.
-
-Where the Licensed Rights include Sui Generis Database Rights that
-apply to Your use of the Licensed Material:
-
- a. for the avoidance of doubt, Section 2(a)(1) grants You the right
- to extract, reuse, reproduce, and Share all or a substantial
- portion of the contents of the database;
-
- b. if You include all or a substantial portion of the database
- contents in a database in which You have Sui Generis Database
- Rights, then the database in which You have Sui Generis Database
- Rights (but not its individual contents) is Adapted Material; and
-
- c. You must comply with the conditions in Section 3(a) if You Share
- all or a substantial portion of the contents of the database.
-
-For the avoidance of doubt, this Section 4 supplements and does not
-replace Your obligations under this Public License where the Licensed
-Rights include other Copyright and Similar Rights.
-
-
-Section 5 -- Disclaimer of Warranties and Limitation of Liability.
-
- a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
- EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
- AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
- ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
- IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
- WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
- PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
- ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
- KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
- ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
-
- b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
- TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
- NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
- INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
- COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
- USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
- ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
- DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
- IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
-
- c. The disclaimer of warranties and limitation of liability provided
- above shall be interpreted in a manner that, to the extent
- possible, most closely approximates an absolute disclaimer and
- waiver of all liability.
-
-
-Section 6 -- Term and Termination.
-
- a. This Public License applies for the term of the Copyright and
- Similar Rights licensed here. However, if You fail to comply with
- this Public License, then Your rights under this Public License
- terminate automatically.
-
- b. Where Your right to use the Licensed Material has terminated under
- Section 6(a), it reinstates:
-
- 1. automatically as of the date the violation is cured, provided
- it is cured within 30 days of Your discovery of the
- violation; or
-
- 2. upon express reinstatement by the Licensor.
-
- For the avoidance of doubt, this Section 6(b) does not affect any
- right the Licensor may have to seek remedies for Your violations
- of this Public License.
-
- c. For the avoidance of doubt, the Licensor may also offer the
- Licensed Material under separate terms or conditions or stop
- distributing the Licensed Material at any time; however, doing so
- will not terminate this Public License.
-
- d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
- License.
-
-
-Section 7 -- Other Terms and Conditions.
-
- a. The Licensor shall not be bound by any additional or different
- terms or conditions communicated by You unless expressly agreed.
-
- b. Any arrangements, understandings, or agreements regarding the
- Licensed Material not stated herein are separate from and
- independent of the terms and conditions of this Public License.
-
-
-Section 8 -- Interpretation.
-
- a. For the avoidance of doubt, this Public License does not, and
- shall not be interpreted to, reduce, limit, restrict, or impose
- conditions on any use of the Licensed Material that could lawfully
- be made without permission under this Public License.
-
- b. To the extent possible, if any provision of this Public License is
- deemed unenforceable, it shall be automatically reformed to the
- minimum extent necessary to make it enforceable. If the provision
- cannot be reformed, it shall be severed from this Public License
- without affecting the enforceability of the remaining terms and
- conditions.
-
- c. No term or condition of this Public License will be waived and no
- failure to comply consented to unless expressly agreed to by the
- Licensor.
-
- d. Nothing in this Public License constitutes or may be interpreted
- as a limitation upon, or waiver of, any privileges and immunities
- that apply to the Licensor or You, including from the legal
- processes of any jurisdiction or authority.
-
-
-=======================================================================
-
-Creative Commons is not a party to its public
-licenses. Notwithstanding, Creative Commons may elect to apply one of
-its public licenses to material it publishes and in those instances
-will be considered the “Licensor.” The text of the Creative Commons
-public licenses is dedicated to the public domain under the CC0 Public
-Domain Dedication. Except for the limited purpose of indicating that
-material is shared under a Creative Commons public license or as
-otherwise permitted by the Creative Commons policies published at
-creativecommons.org/policies, Creative Commons does not authorize the
-use of the trademark "Creative Commons" or any other trademark or logo
-of Creative Commons without its prior written consent including,
-without limitation, in connection with any unauthorized modifications
-to any of its public licenses or any other arrangements,
-understandings, or agreements concerning use of licensed material. For
-the avoidance of doubt, this paragraph does not form part of the
-public licenses.
-
-Creative Commons may be contacted at creativecommons.org.
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2025 The Dapr Authors.
+
+ and others that have contributed code to the public domain.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/daprdocs/content/en/concepts/dapr-services/sidecar.md b/daprdocs/content/en/concepts/dapr-services/sidecar.md
index 1d783b78f..8e57144a3 100644
--- a/daprdocs/content/en/concepts/dapr-services/sidecar.md
+++ b/daprdocs/content/en/concepts/dapr-services/sidecar.md
@@ -52,7 +52,7 @@ For a detailed list of all available arguments run `daprd --help` or see this [t
1. Specify the port your application is listening to
```bash
- daprd --app-id --app-port 5000
+ daprd --app-id myapp --app-port 5000
```
1. If you are using several custom resources and want to specify the location of the resource definition files, use the `--resources-path` argument:
diff --git a/daprdocs/content/en/contributing/presentations.md b/daprdocs/content/en/contributing/presentations.md
index 034cdc4a0..9ae63f1a6 100644
--- a/daprdocs/content/en/contributing/presentations.md
+++ b/daprdocs/content/en/contributing/presentations.md
@@ -6,9 +6,14 @@ weight: 20
description: How to give a presentation on Dapr and examples
---
-We welcome community members giving presentations on Dapr and spreading the word about all the awesome Dapr features! We offer a template PowerPoint file to get started.
+We encourage community members to give presentations on Dapr. To get you started quickly, we offer two PowerPoint files:
-{{< button text="Download the Dapr Presentation Deck" link="/presentations/dapr-slidedeck.pptx.zip" >}}
+- *dapr-slidedeck.pptx*, this is a 150+ page slide deck and contains; an overview of Dapr, all of its building block APIs, cross-cutting concerns, hosting options, and assets to create your own architecture diagrams.
+- *dapr-workflow.pptx*, this is a dedicated slide deck about Dapr workflow and contains; durable execution concept, workflow authoring, workflow patterns, workflow management, and challenges & tips.
+
+There is a downloadable zip file contains both slide decks.
+
+{{< button text="Download the Dapr Presentation Decks" link="/presentations/dapr-slidedecks.zip" >}}
{{% alert color="primary" %}}
If you're using the PowerPoint template with MacOS, please install the Space Grotesk font to ensure the text is rendered properly:
@@ -19,19 +24,16 @@ brew install --cask font-space-grotesk
## Giving a Dapr presentation
-- Begin by downloading the [Dapr Presentation Deck](/presentations/dapr-slidedeck.pptx.zip). This contains slides and diagrams needed to give a Dapr presentation.
+- Begin by downloading the [Dapr Presentation Decks](/presentations/dapr-slidedecks.zip). These contain slides, diagrams, and graphical assets needed to give a Dapr presentation.
- Next, review the docs to make sure you understand the [concepts]({{< ref concepts >}}).
-- Use the Dapr [quickstarts](https://github.com/dapr/quickstarts) repo and [samples](https://github.com/dapr/samples) repo to show demos of how to use Dapr.
+- Use the Dapr [quickstarts](https://github.com/dapr/quickstarts) repo to show demos of how to use Dapr.
+- Once you've done a Dapr presentation, claim the *Dapr Presenter* badge by adding your presentation to [this table](https://github.com/dapr/community/tree/master/presentations) in the Dapr Community repository.
-## Previous Dapr presentations
+## Dapr presentations from the community
-| Presentation | Recording | Deck |
-|--------------|-----------|------|
-| Running Event-Driven Pub/Sub Microservices In Kubernetes With Dapr | [Link](https://youtu.be/-4sHUvfk2Eg) | N/A
-| Ignite 2019: Mark Russinovich Presents the Future of Cloud Native Applications | [Link](https://www.youtube.com/watch?v=LAUDVk8PaCY) | [Link](/presentations/2019IgniteCloudNativeApps.pdf)
-| Azure Community Live: Build microservice applications using DAPR with Mark Fussell | [Link](https://www.youtube.com/watch?v=CgqI7nen-Ng) | N/A
-| Ready 2020: Mark Russinovich Presents Cloud Native Applications | [Link](https://youtu.be/eJCu6a-x9uo?t=1614) | [Link](/presentations/2020ReadyCloudNativeApps.pdf)
-| Ignite 2021: Mark Russinovich Presents Dapr v1.0 Release | [Link](https://youtu.be/69PrhWQorEM?t=3789) | N/A
+If you need some inspiration, watch these Dapr presentations by the community via this [Dapr YouTube playlist](https://youtube.com/playlist?list=PLcip_LgkYwztNWGLdO6yROA3zKl-uUu7h&si=dLMS2CPPyMsfl-QQ):
+
+
## Additional resources
diff --git a/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md b/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md
index 99b080402..61a6e671f 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/actors/actors-runtime-config.md
@@ -195,12 +195,8 @@ func configHandler(w http.ResponseWriter, r *http.Request) {
{{< /tabs >}}
-## Next steps
-
-{{< button text="Enable actor reminder partitioning >>" page="howto-actors-partitioning.md" >}}
-
## Related links
- Refer to the [Dapr SDK documentation and examples]({{< ref "developing-applications/sdks/#sdk-languages" >}}).
- [Actors API reference]({{< ref actors_api.md >}})
-- [Actors overview]({{< ref actors-overview.md >}})
\ No newline at end of file
+- [Actors overview]({{< ref actors-overview.md >}})
diff --git a/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md b/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md
index 79c7303ab..843e656f0 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/actors/howto-actors-partitioning.md
@@ -8,6 +8,13 @@ aliases:
- "/developing-applications/building-blocks/actors/actors-background"
---
+{{% alert title="Warning" color="warning" %}}
+This feature is only relevant when using state store actor reminders, no longer enabled by default.
+As of v1.15, Dapr uses the far more performant [Scheduler Actor Reminders]({{< ref "scheduler.md#actor-reminders" >}}) by default.
+This page is only relevant if you are using the legacy state store actor reminders, enabled via setting the [`SchedulerReminders` feature flag]({{< ref "support-preview-features.md#current-preview-features" >}}) to false.
+It is highly recommended you use using the Scheduler Actor Reminders feature.
+{{% /alert %}}
+
[Actor reminders]({{< ref "actors-timers-reminders.md#actor-reminders" >}}) are persisted and continue to be triggered after sidecar restarts. Applications with multiple reminders registered can experience the following issues:
- Low throughput on reminders registration and de-registration
@@ -193,4 +200,4 @@ Watch [this video for a demo of actor reminder partitioning](https://youtu.be/Zw
## Related links
- [Actors API reference]({{< ref actors_api.md >}})
-- [Actors overview]({{< ref actors-overview.md >}})
\ No newline at end of file
+- [Actors overview]({{< ref actors-overview.md >}})
diff --git a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md
index 02df63c20..a67fdeb96 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-bindings.md
@@ -110,40 +110,30 @@ The code examples below leverage Dapr SDKs to invoke the output bindings endpoin
{{% codetab %}}
+Here's an example of using a console app with top-level statements in .NET 6+:
+
```csharp
-//dependencies
-using System;
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Net.Http.Headers;
+using System.Text;
using System.Threading.Tasks;
using Dapr.Client;
-using Microsoft.AspNetCore.Mvc;
-using System.Threading;
-//code
-namespace EventService
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+var app = builder.Build();
+
+const string BINDING_NAME = "checkout";
+const string BINDING_OPERATION = "create";
+
+var random = new Random();
+using var daprClient = app.Services.GetRequiredService();
+
+while (true)
{
- class Program
- {
- static async Task Main(string[] args)
- {
- string BINDING_NAME = "checkout";
- string BINDING_OPERATION = "create";
- while(true)
- {
- System.Threading.Thread.Sleep(5000);
- Random random = new Random();
- int orderId = random.Next(1,1000);
- using var client = new DaprClientBuilder().Build();
- //Using Dapr SDK to invoke output binding
- await client.InvokeBindingAsync(BINDING_NAME, BINDING_OPERATION, orderId);
- Console.WriteLine("Sending message: " + orderId);
- }
- }
- }
+ await Task.Delay(TimeSpan.FromSeconds(5));
+ var orderId = random.Next(1, 1000);
+ await client.InvokeBindingAsync(BINDING_NAME, BINDING_OPERATION, orderId);
+ Console.WriteLine($"Sending message: {orderId}");
}
-
```
{{% /codetab %}}
diff --git a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md
index 4a5f6d4dd..2f47547e6 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/bindings/howto-triggers.md
@@ -113,34 +113,41 @@ Configure your application to receive incoming events. If you're using HTTP, you
- Listen on a `POST` endpoint with the name of the binding, as specified in `metadata.name` in the `binding.yaml` file.
- Verify your application allows Dapr to make an `OPTIONS` request for this endpoint.
-Below are code examples that leverage Dapr SDKs to demonstrate an output binding.
+Below are code examples that leverage Dapr SDKs to demonstrate an input binding.
{{< tabs ".NET" Java Python Go JavaScript>}}
{{% codetab %}}
+The following example demonstrates how to configure an input binding using ASP.NET Core controllers.
+
```csharp
-//dependencies
using System.Collections.Generic;
using System.Threading.Tasks;
using System;
using Microsoft.AspNetCore.Mvc;
-//code
-namespace CheckoutService.controller
+namespace CheckoutService.controller;
+
+[ApiController]
+public sealed class CheckoutServiceController : ControllerBase
{
- [ApiController]
- public class CheckoutServiceController : Controller
+ [HttpPost("/checkout")]
+ public ActionResult getCheckout([FromBody] int orderId)
{
- [HttpPost("/checkout")]
- public ActionResult getCheckout([FromBody] int orderId)
- {
- Console.WriteLine("Received Message: " + orderId);
- return "CID" + orderId;
- }
+ Console.WriteLine($"Received Message: {orderId}");
+ return $"CID{orderId}";
}
}
+```
+The following example demonstrates how to configure the same input binding using a minimal API approach:
+```csharp
+app.MapPost("checkout", ([FromBody] int orderId) =>
+{
+ Console.WriteLine($"Received Message: {orderId}");
+ return $"CID{orderId}"
+});
```
{{% /codetab %}}
diff --git a/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md b/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md
index 25d4169e2..5b663c3ea 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/configuration/howto-manage-configuration.md
@@ -76,27 +76,21 @@ The following example shows how to get a saved configuration item using the Dapr
{{% codetab %}}
```csharp
-//dependencies
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Dapr.Client;
-//code
-namespace ConfigurationApi
-{
- public class Program
- {
- private static readonly string CONFIG_STORE_NAME = "configstore";
+const string CONFIG_STORE_NAME = "configstore";
- public static async Task Main(string[] args)
- {
- using var client = new DaprClientBuilder().Build();
- var configuration = await client.GetConfiguration(CONFIG_STORE_NAME, new List() { "orderId1", "orderId2" });
- Console.WriteLine($"Got key=\n{configuration[0].Key} -> {configuration[0].Value}\n{configuration[1].Key} -> {configuration[1].Value}");
- }
- }
-}
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+var app = builder.Build();
+
+using var client = app.Services.GetRequiredServices();
+
+var configuration = await client.GetConfiguration(CONFIG_STORE_NAME, [ "orderId1", "orderId2" ]);
+Console.WriteLine($"Got key=\n{configuration[0].Key} -> {configuration[0].Value}\n{configuration[1].Key} -> {configuration[1].Value}");
```
{{% /codetab %}}
@@ -261,13 +255,19 @@ using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Dapr.Client;
+using System.Text.Json;
const string DAPR_CONFIGURATION_STORE = "configstore";
-var CONFIGURATION_KEYS = new List { "orderId1", "orderId2" };
-var client = new DaprClientBuilder().Build();
+var CONFIGURATION_ITEMS = new List { "orderId1", "orderId2" };
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+var app = builder.Build();
+
+var client = app.Services.GetRequiredService();
// Subscribe for configuration changes
-SubscribeConfigurationResponse subscribe = await client.SubscribeConfiguration(DAPR_CONFIGURATION_STORE, CONFIGURATION_ITEMS);
+var subscribe = await client.SubscribeConfiguration(DAPR_CONFIGURATION_STORE, CONFIGURATION_ITEMS);
// Print configuration changes
await foreach (var items in subscribe.Source)
@@ -279,7 +279,7 @@ await foreach (var items in subscribe.Source)
subscriptionId = subscribe.Id;
continue;
}
- var cfg = System.Text.Json.JsonSerializer.Serialize(items);
+ var cfg = JsonSerializer.Serialize(items);
Console.WriteLine("Configuration update " + cfg);
}
```
@@ -303,40 +303,23 @@ using Dapr.Extensions.Configuration;
using System.Collections.Generic;
using System.Threading;
-namespace ConfigurationApi
-{
- public class Program
- {
- public static void Main(string[] args)
- {
- Console.WriteLine("Starting application.");
- CreateHostBuilder(args).Build().Run();
- Console.WriteLine("Closing application.");
- }
+Console.WriteLine("Starting application.");
+var builder = WebApplication.CreateBuilder(args);
- ///
- /// Creates WebHost Builder.
- ///
- /// Arguments.
- /// Returns IHostbuilder.
- public static IHostBuilder CreateHostBuilder(string[] args)
- {
- var client = new DaprClientBuilder().Build();
- return Host.CreateDefaultBuilder(args)
- .ConfigureAppConfiguration(config =>
- {
- // Get the initial value and continue to watch it for changes.
- config.AddDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
- config.AddStreamingDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
+// Unlike most other situations, we build a `DaprClient` here using its factory because we cannot rely on `IConfiguration`
+// or other injected services to configure it because we haven't yet built the DI container.
+var client = new DaprClientBuilder().Build();
- })
- .ConfigureWebHostDefaults(webBuilder =>
- {
- webBuilder.UseStartup();
- });
- }
- }
-}
+// In a real-world application, you'd also add the following line to register the `DaprClient` with the DI container so
+// it can be injected into other services. In this demonstration, it's not necessary as we're not injecting it anywhere.
+// builder.Services.AddDaprClient();
+
+// Get the initial value and continue to watch it for changes
+builder.Configuration.AddDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
+builder.Configuration.AddStreamingDaprConfigurationStore("configstore", new List() { "orderId1","orderId2" }, client, TimeSpan.FromSeconds(20));
+
+await builder.Build().RunAsync();
+Console.WriteLine("Closing application.");
```
Navigate to the directory containing the above code, then run the following command to launch both a Dapr sidecar and the subscriber application:
@@ -524,29 +507,23 @@ Following are the code examples showing how you can unsubscribe to configuration
{{< tabs ".NET" Java Python Go JavaScript "HTTP API (BASH)" "HTTP API (Powershell)">}}
{{% codetab %}}
+
```csharp
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Dapr.Client;
-const string DAPR_CONFIGURATION_STORE = "configstore";
-var client = new DaprClientBuilder().Build();
+var builder = WebApplication.CreateBuilder();
+builder.Services.AddDaprClient();
+var app = builder.Build();
-// Unsubscribe to config updates and exit the app
-async Task unsubscribe(string subscriptionId)
-{
- try
- {
- await client.UnsubscribeConfiguration(DAPR_CONFIGURATION_STORE, subscriptionId);
- Console.WriteLine("App unsubscribed from config changes");
- Environment.Exit(0);
- }
- catch (Exception ex)
- {
- Console.WriteLine("Error unsubscribing from config updates: " + ex.Message);
- }
-}
+const string DAPR_CONFIGURATION_STORE = "configstore";
+const string SubscriptionId = "abc123"; //Replace with the subscription identifier to unsubscribe from
+var client = app.Services.GetRequiredService();
+
+await client.UnsubscribeConfiguration(DAPR_CONFIGURATION_STORE, SubscriptionId);
+Console.WriteLine("App unsubscribed from config changes");
```
{{% /codetab %}}
diff --git a/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md b/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md
index 38cce1067..14e573d7f 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/conversation/conversation-overview.md
@@ -30,7 +30,7 @@ Prompt caching optimizes performance by storing and reusing prompts that are oft
### Personally identifiable information (PII) obfuscation
-The PII obfuscation feature identifies and removes any form of sensitve user information from a conversation response. Simply enable PII obfuscation on input and output data to protect your privacy and scrub sensitive details that could be used to identify an individual.
+The PII obfuscation feature identifies and removes any form of sensitive user information from a conversation response. Simply enable PII obfuscation on input and output data to protect your privacy and scrub sensitive details that could be used to identify an individual.
The PII scrubber obfuscates the following user information:
- Phone number
diff --git a/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md
index fbdac273e..e75e3466d 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/jobs/jobs-features-concepts.md
@@ -6,7 +6,7 @@ weight: 2000
description: "Learn more about the Dapr Jobs features and concepts"
---
-Now that you've learned about the [jobs building block]({{< ref jobs-overview.md >}}) at a high level, let's deep dive
+Now that you've learned about the [jobs building block]({{< ref jobs-overview.md >}}) at a high level, let's deep dive
into the features and concepts included with Dapr Jobs and the various SDKs. Dapr Jobs:
- Provides a robust and scalable API for scheduling operations to be triggered in the future.
- Exposes several capabilities which are common across all supported languages.
@@ -15,19 +15,19 @@ into the features and concepts included with Dapr Jobs and the various SDKs. Dap
## Job identity
-All jobs are registered with a case-sensitive job name. These names are intended to be unique across all services
-interfacing with the Dapr runtime. The name is used as an identifier when creating and modifying the job as well as
+All jobs are registered with a case-sensitive job name. These names are intended to be unique across all services
+interfacing with the Dapr runtime. The name is used as an identifier when creating and modifying the job as well as
to indicate which job a triggered invocation is associated with.
-Only one job can be associated with a name at any given time. By default, any attempt to create a new job using the same name as an existing job results in an error. However, if the `overwrite` flag is set to `true`, the new job overwrites the existing job with the same name.
+Only one job can be associated with a name at any given time. By default, any attempt to create a new job using the same name as an existing job results in an error. However, if the `overwrite` flag is set to `true`, the new job overwrites the existing job with the same name.
## Scheduling Jobs
A job can be scheduled using any of the following mechanisms:
- Intervals using Cron expressions, duration values, or period expressions
- Specific dates and times
-For all time-based schedules, if a timestamp is provided with a time zone via the RFC3339 specification, that
-time zone is used. When not provided, the time zone used by the server running Dapr is used.
+For all time-based schedules, if a timestamp is provided with a time zone via the RFC3339 specification, that
+time zone is used. When not provided, the time zone used by the server running Dapr is used.
In other words, do **not** assume that times run in UTC time zone, unless otherwise specified when scheduling
the job.
@@ -47,7 +47,7 @@ fields spanning the values specified in the table below:
### Schedule using a duration value
You can schedule jobs using [a Go duration string](https://pkg.go.dev/time#ParseDuration), in which
-a string consists of a (possibly) signed sequence of decimal numbers, each with an optional fraction and a unit suffix.
+a string consists of a (possibly) signed sequence of decimal numbers, each with an optional fraction and a unit suffix.
Valid time units are `"ns"`, `"us"`, `"ms"`, `"s"`, `"m"`, or `"h"`.
#### Example 1
@@ -69,7 +69,7 @@ The following period expressions are supported. The "@every" expression also acc
| @hourly | Run once an hour at the beginning of the hour | 0 0 * * * * |
### Schedule using a specific date/time
-A job can also be scheduled to run at a particular point in time by providing a date using the
+A job can also be scheduled to run at a particular point in time by providing a date using the
[RFC3339 specification](https://www.rfc-editor.org/rfc/rfc3339).
#### Example 1
@@ -106,7 +106,7 @@ In this setup, you have full control over how triggered jobs are received and pr
through this gRPC method.
### HTTP
-If a gRPC server isn't registered with Dapr when the application starts up, Dapr instead triggers jobs by making a
+If a gRPC server isn't registered with Dapr when the application starts up, Dapr instead triggers jobs by making a
POST request to the endpoint `/job/`. The body includes the following information about the job:
- `Schedule`: When the job triggers occur
- `RepeatCount`: An optional value indicating how often the job should repeat
@@ -115,7 +115,8 @@ or the not-before time from which the schedule should take effect
- `Ttl`: An optional value indicating when the job should expire
- `Payload`: A collection of bytes containing data originally stored when the job was scheduled
- `Overwrite`: A flag to allow the requested job to overwrite an existing job with the same name, if it already exists.
+- `FailurePolicy`: An optional failure policy for the job.
The `DueTime` and `Ttl` fields will reflect an RC3339 timestamp value reflective of the time zone provided when the job was
originally scheduled. If no time zone was provided, these values indicate the time zone used by the server running
-Dapr.
\ No newline at end of file
+Dapr.
diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md
index 86e8f2491..1778b7716 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-publish-subscribe.md
@@ -199,7 +199,6 @@ Below are code examples that leverage Dapr SDKs to subscribe to the topic you de
{{% codetab %}}
```csharp
-//dependencies
using System.Collections.Generic;
using System.Threading.Tasks;
using System;
@@ -207,19 +206,17 @@ using Microsoft.AspNetCore.Mvc;
using Dapr;
using Dapr.Client;
-//code
-namespace CheckoutService.controller
+namespace CheckoutService.Controllers;
+
+[ApiController]
+public sealed class CheckoutServiceController : ControllerBase
{
- [ApiController]
- public class CheckoutServiceController : Controller
+ //Subscribe to a topic called "orders" from the "order-pub-sub" compoennt
+ [Topic("order-pub-sub", "orders")]
+ [HttpPost("checkout")]
+ public void GetCheckout([FromBody] int orderId)
{
- //Subscribe to a topic
- [Topic("order-pub-sub", "orders")]
- [HttpPost("checkout")]
- public void getCheckout([FromBody] int orderId)
- {
- Console.WriteLine("Subscriber received : " + orderId);
- }
+ Console.WriteLine("Subscriber received : " + orderId);
}
}
```
@@ -435,38 +432,34 @@ Below are code examples that leverage Dapr SDKs to publish a topic.
{{% codetab %}}
```csharp
-//dependencies
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Dapr.Client;
-using Microsoft.AspNetCore.Mvc;
using System.Threading;
-//code
-namespace EventService
-{
- class Program
- {
- static async Task Main(string[] args)
- {
- string PUBSUB_NAME = "order-pub-sub";
- string TOPIC_NAME = "orders";
- while(true) {
- System.Threading.Thread.Sleep(5000);
- Random random = new Random();
- int orderId = random.Next(1,1000);
- CancellationTokenSource source = new CancellationTokenSource();
- CancellationToken cancellationToken = source.Token;
- using var client = new DaprClientBuilder().Build();
- //Using Dapr SDK to publish a topic
- await client.PublishEventAsync(PUBSUB_NAME, TOPIC_NAME, orderId, cancellationToken);
- Console.WriteLine("Published data: " + orderId);
- }
- }
- }
+const string PUBSUB_NAME = "order-pub-sub";
+const string TOPIC_NAME = "orders";
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+
+var app = builder.Build();
+var random = new Random();
+
+var client = app.Services.GetRequiredService();
+
+while(true) {
+ await Task.Delay(TimeSpan.FromSeconds(5));
+ var orderId = random.Next(1,1000);
+ var source = new CancellationTokenSource();
+ var cancellationToken = source.Token;
+
+ //Using Dapr SDK to publish a topic
+ await client.PublishEventAsync(PUBSUB_NAME, TOPIC_NAME, orderId, cancellationToken);
+ Console.WriteLine("Published data: " + orderId);
}
```
diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-route-messages.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-route-messages.md
index 487a7badc..b6da0fffd 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-route-messages.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-route-messages.md
@@ -403,7 +403,7 @@ The following attributes are **optional** to appear in CloudEvents. See the [Not
- **Constraints:**
- OPTIONAL
- If present, must adhere to the format specified in [RFC 2046](https://tools.ietf.org/html/rfc2046)
-- For Media Type examples, see [IANA Media Types](http://www.iana.org/assignments/media-types/media-types.xhtml)
+- For Media Type examples, see [IANA Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml)
#### dataschema
diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md
index 5b4fe2c1b..948e2cd26 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/pubsub-raw.md
@@ -6,7 +6,7 @@ weight: 2200
description: "Learn when you might not use CloudEvents and how to disable them."
---
-When adding Dapr to your application, some services may still need to communicate via pub/sub messages not encapsulated in CloudEvents, due to either compatibility reasons or some apps not using Dapr. These are referred to as "raw" pub/sub messages. Dapr enables apps to [publish and subscribe to raw events]({{< ref "pubsub-cloudevents.md#publishing-raw-messages" >}}) not wrapped in a CloudEvent for compatibility.
+When adding Dapr to your application, some services may still need to communicate via pub/sub messages not encapsulated in CloudEvents, due to either compatibility reasons or some apps not using Dapr. These are referred to as "raw" pub/sub messages. Dapr enables apps to [publish and subscribe to raw events]({{< ref "pubsub-cloudevents.md#publishing-raw-messages" >}}) not wrapped in a CloudEvent for compatibility and to send data that is not JSON serializable.
## Publishing raw messages
@@ -105,13 +105,15 @@ $app->run(function(\DI\FactoryInterface $factory) {
## Subscribing to raw messages
-Dapr apps are also able to subscribe to raw events coming from existing pub/sub topics that do not use CloudEvent encapsulation.
+Dapr apps can subscribe to raw messages from pub/sub topics, even if they weren’t published as CloudEvents. However, the subscribing Dapr process still wraps these raw messages in a CloudEvent before delivering them to the subscribing application.
### Programmatically subscribe to raw events
-When subscribing programmatically, add the additional metadata entry for `rawPayload` to allow the subscriber to receive a message that is not wrapped by a CloudEvent. For .NET, this metadata entry is called `isRawPayload`.
+When subscribing programmatically, add the additional metadata entry for `rawPayload` to allow the subscriber to receive a message that is not wrapped by a CloudEvent. For .NET, this metadata entry is called `isRawPayload`.
+
+When using raw payloads the message is always base64 encoded with content type `application/octet-stream`.
{{< tabs ".NET" "Python" "PHP" >}}
@@ -242,4 +244,4 @@ scopes:
- Learn more about [publishing and subscribing messages]({{< ref pubsub-overview.md >}})
- List of [pub/sub components]({{< ref supported-pubsub >}})
- Read the [API reference]({{< ref pubsub_api.md >}})
-- Read the .NET sample on how to [consume Kafka messages without CloudEvents](https://github.com/dapr/samples/pubsub-raw-payload)
\ No newline at end of file
+- Read the .NET sample on how to [consume Kafka messages without CloudEvents](https://github.com/dapr/samples/pubsub-raw-payload)
diff --git a/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md b/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md
index 5c31057ee..b5496419a 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/pubsub/subscription-methods.md
@@ -203,7 +203,55 @@ As messages are sent to the given message handler code, there is no concept of r
The example below shows the different ways to stream subscribe to a topic.
-{{< tabs Python Go >}}
+{{< tabs ".NET" Python Go >}}
+
+{{% codetab %}}
+
+You can use the `SubscribeAsync` method on the `DaprPublishSubscribeClient` to configure the message handler to use to pull messages from the stream.
+
+```c#
+using System.Text;
+using Dapr.Messaging.PublishSubscribe;
+using Dapr.Messaging.PublishSubscribe.Extensions;
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprPubSubClient();
+var app = builder.Build();
+
+var messagingClient = app.Services.GetRequiredService();
+
+//Create a dynamic streaming subscription and subscribe with a timeout of 30 seconds and 10 seconds for message handling
+var cancellationTokenSource = new CancellationTokenSource(TimeSpan.FromSeconds(30));
+var subscription = await messagingClient.SubscribeAsync("pubsub", "myTopic",
+ new DaprSubscriptionOptions(new MessageHandlingPolicy(TimeSpan.FromSeconds(10), TopicResponseAction.Retry)),
+ HandleMessageAsync, cancellationTokenSource.Token);
+
+await Task.Delay(TimeSpan.FromMinutes(1));
+
+//When you're done with the subscription, simply dispose of it
+await subscription.DisposeAsync();
+return;
+
+//Process each message returned from the subscription
+Task HandleMessageAsync(TopicMessage message, CancellationToken cancellationToken = default)
+{
+ try
+ {
+ //Do something with the message
+ Console.WriteLine(Encoding.UTF8.GetString(message.Data.Span));
+ return Task.FromResult(TopicResponseAction.Success);
+ }
+ catch
+ {
+ return Task.FromResult(TopicResponseAction.Retry);
+ }
+}
+```
+
+[Learn more about streaming subscriptions using the .NET SDK client.]({{< ref "dotnet-messaging-pubsub-howto.md" >}})
+
+{{% /codetab %}}
+
{{% codetab %}}
diff --git a/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md b/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md
index d45be4636..104acc930 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/secrets/howto-secrets.md
@@ -76,32 +76,25 @@ Now that you've set up the local secret store, call Dapr to get the secrets from
{{% codetab %}}
```csharp
-//dependencies
using System;
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Net.Http.Headers;
using System.Threading.Tasks;
using Dapr.Client;
-using Microsoft.AspNetCore.Mvc;
-using System.Threading;
-using System.Text.Json;
-//code
-namespace EventService
-{
- class Program
- {
- static async Task Main(string[] args)
- {
- string SECRET_STORE_NAME = "localsecretstore";
- using var client = new DaprClientBuilder().Build();
- //Using Dapr SDK to get a secret
- var secret = await client.GetSecretAsync(SECRET_STORE_NAME, "secret");
- Console.WriteLine($"Result: {string.Join(", ", secret)}");
- }
- }
-}
+namespace EventService;
+
+const string SECRET_STORE_NAME = "localsecretstore";
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+var app = builder.Build();
+
+//Resolve a DaprClient from DI
+var daprClient = app.Services.GetRequiredService();
+
+//Use the Dapr SDK to get a secret
+var secret = await daprClient.GetSecretAsync(SECRET_STORE_NAME, "secret");
+
+Console.WriteLine($"Result: {string.Join(", ", secret)}");
```
{{% /codetab %}}
diff --git a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md
index 9466fd4d3..4416242e0 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/service-invocation/howto-invoke-discover-services.md
@@ -413,7 +413,7 @@ dapr invoke --app-id checkout --method checkout/100
You can also append a query string or a fragment to the end of the URL and Dapr will pass it through unchanged. This means that if you need to pass some additional arguments in your service invocation that aren't part of a payload or the path, you can do so by appending a `?` to the end of the URL, followed by the key/value pairs separated by `=` signs and delimited by `&`. For example:
```bash
-curl 'http://dapr-app-id:checkout@localhost:3602/checkout/100?basket=1234&key=abc` -X POST
+curl 'http://dapr-app-id:checkout@localhost:3602/checkout/100?basket=1234&key=abc' -X POST
```
### Namespaces
diff --git a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md
index e630365db..727ea207c 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md
@@ -72,38 +72,27 @@ The following example shows how to save and retrieve a single key/value pair usi
```csharp
-//dependencies
-using System;
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Net.Http.Headers;
+using System.Text;
using System.Threading.Tasks;
using Dapr.Client;
-using Microsoft.AspNetCore.Mvc;
-using System.Threading;
-using System.Text.Json;
-//code
-namespace EventService
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+var app = builder.Build();
+
+var random = new Random();
+//Resolve the DaprClient from its dependency injection registration
+using var client = app.Services.GetRequiredService();
+
+while(true)
{
- class Program
- {
- static async Task Main(string[] args)
- {
- string DAPR_STORE_NAME = "statestore";
- while(true) {
- System.Threading.Thread.Sleep(5000);
- using var client = new DaprClientBuilder().Build();
- Random random = new Random();
- int orderId = random.Next(1,1000);
- //Using Dapr SDK to save and get state
- await client.SaveStateAsync(DAPR_STORE_NAME, "order_1", orderId.ToString());
- await client.SaveStateAsync(DAPR_STORE_NAME, "order_2", orderId.ToString());
- var result = await client.GetStateAsync(DAPR_STORE_NAME, "order_1");
- Console.WriteLine("Result after get: " + result);
- }
- }
- }
+ await Task.Delay(TimeSpan.FromSeconds(5));
+ var orderId = random.Next(1,1000);
+ //Using Dapr SDK to save and get state
+ await client.SaveStateAsync(DAPR_STORE_NAME, "order_1", orderId.ToString());
+ await client.SaveStateAsync(DAPR_STORE_NAME, "order_2", orderId.ToString());
+ var result = await client.GetStateAsync(DAPR_STORE_NAME, "order_1");
+ Console.WriteLine($"Result after get: {result}");
}
```
@@ -359,23 +348,20 @@ Below are code examples that leverage Dapr SDKs for deleting the state.
{{% codetab %}}
```csharp
-//dependencies
using Dapr.Client;
+using System.Threading.Tasks;
-//code
-namespace EventService
-{
- class Program
- {
- static async Task Main(string[] args)
- {
- string DAPR_STORE_NAME = "statestore";
- //Using Dapr SDK to delete the state
- using var client = new DaprClientBuilder().Build();
- await client.DeleteStateAsync(DAPR_STORE_NAME, "order_1", cancellationToken: cancellationToken);
- }
- }
-}
+const string DAPR_STORE_NAME = "statestore";
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+var app = builder.Build();
+
+//Resolve the DaprClient from the dependency injection registration
+using var client = app.Services.GetRequiredService();
+
+//Use the DaprClient to delete the state
+await client.DeleteStateAsync(DAPR_STORE_NAME, "order_1", cancellationToken: cancellationToken);
```
To launch a Dapr sidecar for the above example application, run a command similar to the following:
@@ -540,22 +526,19 @@ Below are code examples that leverage Dapr SDKs for saving and retrieving multip
{{% codetab %}}
```csharp
-//dependencies
using Dapr.Client;
-//code
-namespace EventService
-{
- class Program
- {
- static async Task Main(string[] args)
- {
- string DAPR_STORE_NAME = "statestore";
- //Using Dapr SDK to retrieve multiple states
- using var client = new DaprClientBuilder().Build();
- IReadOnlyList multipleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "order_1", "order_2" }, parallelism: 1);
- }
- }
-}
+using System.Threading.Tasks;
+
+const string DAPR_STORE_NAME = "statestore";
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Services.AddDaprClient();
+var app = builder.Build();
+
+//Resolve the DaprClient from the dependency injection registration
+using var client = app.Services.GetRequiredService();
+
+IReadOnlyList multipleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "order_1", "order_2" }, parallelism: 1);
```
To launch a Dapr sidecar for the above example application, run a command similar to the following:
@@ -567,28 +550,21 @@ dapr run --app-id orderprocessing --app-port 6001 --dapr-http-port 3601 --dapr-g
The above example returns a `BulkStateItem` with the serialized format of the value you saved to state. If you prefer that the value be deserialized by the SDK across each of your bulk response items, you can instead use the following:
```csharp
-//dependencies
using Dapr.Client;
-//code
-namespace EventService
-{
- class Program
- {
- static async Task Main(string[] args)
- {
- string DAPR_STORE_NAME = "statestore";
- //Using Dapr SDK to retrieve multiple states
- using var client = new DaprClientBuilder().Build();
- IReadOnlyList> mulitpleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "widget_1", "widget_2" }, parallelism: 1);
- }
- }
+using System.Threading.Tasks;
- class Widget
- {
- string Size { get; set; }
- string Color { get; set; }
- }
-}
+const string DAPR_STORE_NAME = "statestore";
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Serivces.AddDaprClient();
+var app = builder.Build();
+
+//Resolve the DaprClient from the dependency injection registration
+using var client = app.Services.GetRequiredService();
+
+IReadOnlyList> mulitpleStateResult = await client.GetBulkStateAsync(DAPR_STORE_NAME, new List { "widget_1", "widget_2" }, parallelism: 1);
+
+record Widget(string Size, string Color);
```
{{% /codetab %}}
@@ -791,44 +767,36 @@ Below are code examples that leverage Dapr SDKs for performing state transaction
{{% codetab %}}
```csharp
-//dependencies
-using System;
-using System.Collections.Generic;
-using System.Net.Http;
-using System.Net.Http.Headers;
-using System.Threading.Tasks;
using Dapr.Client;
-using Microsoft.AspNetCore.Mvc;
-using System.Threading;
-using System.Text.Json;
+using System.Threading.Tasks;
-//code
-namespace EventService
+const string DAPR_STORE_NAME = "statestore";
+
+var builder = WebApplication.CreateBuilder(args);
+builder.Serivces.AddDaprClient();
+var app = builder.Build();
+
+//Resolve the DaprClient from the dependency injection registration
+using var client = app.Services.GetRequiredService();
+
+var random = new Random();
+
+while (true)
{
- class Program
- {
- static async Task Main(string[] args)
- {
- string DAPR_STORE_NAME = "statestore";
- while(true) {
- System.Threading.Thread.Sleep(5000);
- Random random = new Random();
- int orderId = random.Next(1,1000);
- using var client = new DaprClientBuilder().Build();
- var requests = new List()
- {
- new StateTransactionRequest("order_3", JsonSerializer.SerializeToUtf8Bytes(orderId.ToString()), StateOperationType.Upsert),
- new StateTransactionRequest("order_2", null, StateOperationType.Delete)
- };
- CancellationTokenSource source = new CancellationTokenSource();
- CancellationToken cancellationToken = source.Token;
- //Using Dapr SDK to perform the state transactions
- await client.ExecuteStateTransactionAsync(DAPR_STORE_NAME, requests, cancellationToken: cancellationToken);
- Console.WriteLine("Order requested: " + orderId);
- Console.WriteLine("Result: " + result);
- }
- }
- }
+ await Task.Delay(TimeSpan.FromSeconds(5));
+ var orderId = random.Next(1, 1000);
+ var requests = new List
+ {
+ new StateTransactionRequest("order_3", JsonSerializer.SerializeToUtf8Bytes(orderId.ToString()), StateOperationType.Upsert),
+ new StateTransactionRequest("order_2", null, StateOperationType.Delete)
+ };
+ var cancellationTokenSource = new CancellationTokenSource();
+ var cancellationToken = cancellationTokenSource.Token;
+
+ //Use the DaprClient to perform the state transactions
+ await client.ExecuteStateTransactionAsync(DAPR_STORE_NAME, requests, cancellationToken: cancellationToken);
+ Console.WriteLine($"Order requested: {orderId}");
+ Console.WriteLine($"Result: {result}");
}
```
diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md
index 3345b97b2..009850fae 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-author-workflow.md
@@ -39,13 +39,14 @@ The Dapr sidecar doesn’t load any workflow definitions. Rather, the sidecar si
Define the workflow activities you'd like your workflow to perform. Activities are a function definition and can take inputs and outputs. The following example creates a counter (activity) called `hello_act` that notifies users of the current counter value. `hello_act` is a function derived from a class called `WorkflowActivityContext`.
```python
-def hello_act(ctx: WorkflowActivityContext, input):
+@wfr.activity(name='hello_act')
+def hello_act(ctx: WorkflowActivityContext, wf_input):
global counter
- counter += input
+ counter += wf_input
print(f'New counter value is: {counter}!', flush=True)
```
-[See the `hello_act` workflow activity in context.](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py#LL40C1-L43C59)
+[See the task chaining workflow activity in context.](https://github.com/dapr/python-sdk/blob/main/examples/workflow/simple.py)
{{% /codetab %}}
@@ -226,19 +227,32 @@ Next, register and call the activites in a workflow.
-The `hello_world_wf` function is derived from a class called `DaprWorkflowContext` with input and output parameter types. It also includes a `yield` statement that does the heavy lifting of the workflow and calls the workflow activities.
+The `hello_world_wf` function is a function derived from a class called `DaprWorkflowContext` with input and output parameter types. It also includes a `yield` statement that does the heavy lifting of the workflow and calls the workflow activities.
```python
-def hello_world_wf(ctx: DaprWorkflowContext, input):
- print(f'{input}')
+@wfr.workflow(name='hello_world_wf')
+def hello_world_wf(ctx: DaprWorkflowContext, wf_input):
+ print(f'{wf_input}')
yield ctx.call_activity(hello_act, input=1)
yield ctx.call_activity(hello_act, input=10)
- yield ctx.wait_for_external_event("event1")
+ yield ctx.call_activity(hello_retryable_act, retry_policy=retry_policy)
+ yield ctx.call_child_workflow(child_retryable_wf, retry_policy=retry_policy)
+
+ # Change in event handling: Use when_any to handle both event and timeout
+ event = ctx.wait_for_external_event(event_name)
+ timeout = ctx.create_timer(timedelta(seconds=30))
+ winner = yield when_any([event, timeout])
+
+ if winner == timeout:
+ print('Workflow timed out waiting for event')
+ return 'Timeout'
+
yield ctx.call_activity(hello_act, input=100)
yield ctx.call_activity(hello_act, input=1000)
+ return 'Completed'
```
-[See the `hello_world_wf` workflow in context.](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py#LL32C1-L38C51)
+[See the `hello_world_wf` workflow in context.](https://github.com/dapr/python-sdk/blob/main/examples/workflow/simple.py)
{{% /codetab %}}
@@ -405,89 +419,177 @@ Finally, compose the application using the workflow.
-[In the following example](https://github.com/dapr/python-sdk/blob/master/examples/demo_workflow/app.py), for a basic Python hello world application using the Python SDK, your project code would include:
+[In the following example](https://github.com/dapr/python-sdk/blob/main/examples/workflow/simple.py), for a basic Python hello world application using the Python SDK, your project code would include:
- A Python package called `DaprClient` to receive the Python SDK capabilities.
- A builder with extensions called:
- - `WorkflowRuntime`: Allows you to register workflows and workflow activities
+ - `WorkflowRuntime`: Allows you to register the workflow runtime.
- `DaprWorkflowContext`: Allows you to [create workflows]({{< ref "#write-the-workflow" >}})
- `WorkflowActivityContext`: Allows you to [create workflow activities]({{< ref "#write-the-workflow-activities" >}})
-- API calls. In the example below, these calls start, pause, resume, purge, and terminate the workflow.
+- API calls. In the example below, these calls start, pause, resume, purge, and completing the workflow.
```python
-from dapr.ext.workflow import WorkflowRuntime, DaprWorkflowContext, WorkflowActivityContext
-from dapr.clients import DaprClient
+from datetime import timedelta
+from time import sleep
+from dapr.ext.workflow import (
+ WorkflowRuntime,
+ DaprWorkflowContext,
+ WorkflowActivityContext,
+ RetryPolicy,
+ DaprWorkflowClient,
+ when_any,
+)
+from dapr.conf import Settings
+from dapr.clients.exceptions import DaprInternalError
+
+settings = Settings()
+
+counter = 0
+retry_count = 0
+child_orchestrator_count = 0
+child_orchestrator_string = ''
+child_act_retry_count = 0
+instance_id = 'exampleInstanceID'
+child_instance_id = 'childInstanceID'
+workflow_name = 'hello_world_wf'
+child_workflow_name = 'child_wf'
+input_data = 'Hi Counter!'
+event_name = 'event1'
+event_data = 'eventData'
+non_existent_id_error = 'no such instance exists'
+
+retry_policy = RetryPolicy(
+ first_retry_interval=timedelta(seconds=1),
+ max_number_of_attempts=3,
+ backoff_coefficient=2,
+ max_retry_interval=timedelta(seconds=10),
+ retry_timeout=timedelta(seconds=100),
+)
+
+wfr = WorkflowRuntime()
+
+
+@wfr.workflow(name='hello_world_wf')
+def hello_world_wf(ctx: DaprWorkflowContext, wf_input):
+ print(f'{wf_input}')
+ yield ctx.call_activity(hello_act, input=1)
+ yield ctx.call_activity(hello_act, input=10)
+ yield ctx.call_activity(hello_retryable_act, retry_policy=retry_policy)
+ yield ctx.call_child_workflow(child_retryable_wf, retry_policy=retry_policy)
+
+ # Change in event handling: Use when_any to handle both event and timeout
+ event = ctx.wait_for_external_event(event_name)
+ timeout = ctx.create_timer(timedelta(seconds=30))
+ winner = yield when_any([event, timeout])
+
+ if winner == timeout:
+ print('Workflow timed out waiting for event')
+ return 'Timeout'
+
+ yield ctx.call_activity(hello_act, input=100)
+ yield ctx.call_activity(hello_act, input=1000)
+ return 'Completed'
+
+
+@wfr.activity(name='hello_act')
+def hello_act(ctx: WorkflowActivityContext, wf_input):
+ global counter
+ counter += wf_input
+ print(f'New counter value is: {counter}!', flush=True)
+
+
+@wfr.activity(name='hello_retryable_act')
+def hello_retryable_act(ctx: WorkflowActivityContext):
+ global retry_count
+ if (retry_count % 2) == 0:
+ print(f'Retry count value is: {retry_count}!', flush=True)
+ retry_count += 1
+ raise ValueError('Retryable Error')
+ print(f'Retry count value is: {retry_count}! This print statement verifies retry', flush=True)
+ retry_count += 1
+
+
+@wfr.workflow(name='child_retryable_wf')
+def child_retryable_wf(ctx: DaprWorkflowContext):
+ global child_orchestrator_string, child_orchestrator_count
+ if not ctx.is_replaying:
+ child_orchestrator_count += 1
+ print(f'Appending {child_orchestrator_count} to child_orchestrator_string!', flush=True)
+ child_orchestrator_string += str(child_orchestrator_count)
+ yield ctx.call_activity(
+ act_for_child_wf, input=child_orchestrator_count, retry_policy=retry_policy
+ )
+ if child_orchestrator_count < 3:
+ raise ValueError('Retryable Error')
+
+
+@wfr.activity(name='act_for_child_wf')
+def act_for_child_wf(ctx: WorkflowActivityContext, inp):
+ global child_orchestrator_string, child_act_retry_count
+ inp_char = chr(96 + inp)
+ print(f'Appending {inp_char} to child_orchestrator_string!', flush=True)
+ child_orchestrator_string += inp_char
+ if child_act_retry_count % 2 == 0:
+ child_act_retry_count += 1
+ raise ValueError('Retryable Error')
+ child_act_retry_count += 1
-# ...
def main():
- with DaprClient() as d:
- host = settings.DAPR_RUNTIME_HOST
- port = settings.DAPR_GRPC_PORT
- workflowRuntime = WorkflowRuntime(host, port)
- workflowRuntime = WorkflowRuntime()
- workflowRuntime.register_workflow(hello_world_wf)
- workflowRuntime.register_activity(hello_act)
- workflowRuntime.start()
+ wfr.start()
+ wf_client = DaprWorkflowClient()
- # Start workflow
- print("==========Start Counter Increase as per Input:==========")
- start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent,
- workflow_name=workflowName, input=inputData, workflow_options=workflowOptions)
- print(f"start_resp {start_resp.instance_id}")
+ print('==========Start Counter Increase as per Input:==========')
+ wf_client.schedule_new_workflow(
+ workflow=hello_world_wf, input=input_data, instance_id=instance_id
+ )
- # ...
+ wf_client.wait_for_workflow_start(instance_id)
- # Pause workflow
- d.pause_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- print(f"Get response from {workflowName} after pause call: {getResponse.runtime_status}")
+ # Sleep to let the workflow run initial activities
+ sleep(12)
- # Resume workflow
- d.resume_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- print(f"Get response from {workflowName} after resume call: {getResponse.runtime_status}")
-
- sleep(1)
- # Raise workflow
- d.raise_workflow_event(instance_id=instanceId, workflow_component=workflowComponent,
- event_name=eventName, event_data=eventData)
+ assert counter == 11
+ assert retry_count == 2
+ assert child_orchestrator_string == '1aa2bb3cc'
- sleep(5)
- # Purge workflow
- d.purge_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- try:
- getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- except DaprInternalError as err:
- if nonExistentIDError in err._message:
- print("Instance Successfully Purged")
+ # Pause Test
+ wf_client.pause_workflow(instance_id=instance_id)
+ metadata = wf_client.get_workflow_state(instance_id=instance_id)
+ print(f'Get response from {workflow_name} after pause call: {metadata.runtime_status.name}')
- # Kick off another workflow for termination purposes
- start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent,
- workflow_name=workflowName, input=inputData, workflow_options=workflowOptions)
- print(f"start_resp {start_resp.instance_id}")
+ # Resume Test
+ wf_client.resume_workflow(instance_id=instance_id)
+ metadata = wf_client.get_workflow_state(instance_id=instance_id)
+ print(f'Get response from {workflow_name} after resume call: {metadata.runtime_status.name}')
- # Terminate workflow
- d.terminate_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- sleep(1)
- getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- print(f"Get response from {workflowName} after terminate call: {getResponse.runtime_status}")
+ sleep(2) # Give the workflow time to reach the event wait state
+ wf_client.raise_workflow_event(instance_id=instance_id, event_name=event_name, data=event_data)
- # Purge workflow
- d.purge_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- try:
- getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent)
- except DaprInternalError as err:
- if nonExistentIDError in err._message:
- print("Instance Successfully Purged")
+ print('========= Waiting for Workflow completion', flush=True)
+ try:
+ state = wf_client.wait_for_workflow_completion(instance_id, timeout_in_seconds=30)
+ if state.runtime_status.name == 'COMPLETED':
+ print('Workflow completed! Result: {}'.format(state.serialized_output.strip('"')))
+ else:
+ print(f'Workflow failed! Status: {state.runtime_status.name}')
+ except TimeoutError:
+ print('*** Workflow timed out!')
+
+ wf_client.purge_workflow(instance_id=instance_id)
+ try:
+ wf_client.get_workflow_state(instance_id=instance_id)
+ except DaprInternalError as err:
+ if non_existent_id_error in err._message:
+ print('Instance Successfully Purged')
+
+ wfr.shutdown()
- workflowRuntime.shutdown()
if __name__ == '__main__':
main()
```
-
{{% /codetab %}}
{{% codetab %}}
diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md
index f03f4a4c4..13c0a44ca 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/howto-manage-workflow.md
@@ -14,13 +14,13 @@ Now that you've [authored the workflow and its activities in your application]({
{{% codetab %}}
Manage your workflow within your code. In the workflow example from the [Author a workflow]({{< ref "howto-author-workflow.md#write-the-application" >}}) guide, the workflow is registered in the code using the following APIs:
-- **start_workflow**: Start an instance of a workflow
-- **get_workflow**: Get information on the status of the workflow
+- **schedule_new_workflow**: Start an instance of a workflow
+- **get_workflow_state**: Get information on the status of the workflow
- **pause_workflow**: Pauses or suspends a workflow instance that can later be resumed
- **resume_workflow**: Resumes a paused workflow instance
- **raise_workflow_event**: Raise an event on a workflow
- **purge_workflow**: Removes all metadata related to a specific workflow instance
-- **terminate_workflow**: Terminate or stop a particular instance of a workflow
+- **wait_for_workflow_completion**: Complete a particular instance of a workflow
```python
from dapr.ext.workflow import WorkflowRuntime, DaprWorkflowContext, WorkflowActivityContext
@@ -34,27 +34,28 @@ eventName = "event1"
eventData = "eventData"
# Start the workflow
-start_resp = d.start_workflow(instance_id=instanceId, workflow_component=workflowComponent,
- workflow_name=workflowName, input=inputData, workflow_options=workflowOptions)
+wf_client.schedule_new_workflow(
+ workflow=hello_world_wf, input=input_data, instance_id=instance_id
+ )
# Get info on the workflow
-getResponse = d.get_workflow(instance_id=instanceId, workflow_component=workflowComponent)
+wf_client.get_workflow_state(instance_id=instance_id)
# Pause the workflow
-d.pause_workflow(instance_id=instanceId, workflow_component=workflowComponent)
+wf_client.pause_workflow(instance_id=instance_id)
+ metadata = wf_client.get_workflow_state(instance_id=instance_id)
# Resume the workflow
-d.resume_workflow(instance_id=instanceId, workflow_component=workflowComponent)
+wf_client.resume_workflow(instance_id=instance_id)
# Raise an event on the workflow.
- d.raise_workflow_event(instance_id=instanceId, workflow_component=workflowComponent,
- event_name=eventName, event_data=eventData)
+wf_client.raise_workflow_event(instance_id=instance_id, event_name=event_name, data=event_data)
# Purge the workflow
-d.purge_workflow(instance_id=instanceId, workflow_component=workflowComponent)
+wf_client.purge_workflow(instance_id=instance_id)
-# Terminate the workflow
-d.terminate_workflow(instance_id=instanceId, workflow_component=workflowComponent)
+# Wait for workflow completion
+wf_client.wait_for_workflow_completion(instance_id, timeout_in_seconds=30)
```
{{% /codetab %}}
@@ -137,31 +138,29 @@ Manage your workflow within your code. In the `OrderProcessingWorkflow` example
```csharp
string orderId = "exampleOrderId";
-string workflowComponent = "dapr";
-string workflowName = "OrderProcessingWorkflow";
OrderPayload input = new OrderPayload("Paperclips", 99.95);
Dictionary workflowOptions; // This is an optional parameter
-// Start the workflow. This returns back a "StartWorkflowResponse" which contains the instance ID for the particular workflow instance.
-StartWorkflowResponse startResponse = await daprClient.StartWorkflowAsync(orderId, workflowComponent, workflowName, input, workflowOptions);
+// Start the workflow using the orderId as our workflow ID. This returns a string containing the instance ID for the particular workflow instance, whether we provide it ourselves or not.
+await daprWorkflowClient.ScheduleNewWorkflowAsync(nameof(OrderProcessingWorkflow), orderId, input, workflowOptions);
// Get information on the workflow. This response contains information such as the status of the workflow, when it started, and more!
-GetWorkflowResponse getResponse = await daprClient.GetWorkflowAsync(orderId, workflowComponent, eventName);
+WorkflowState currentState = await daprWorkflowClient.GetWorkflowStateAsync(orderId, orderId);
// Terminate the workflow
-await daprClient.TerminateWorkflowAsync(orderId, workflowComponent);
+await daprWorkflowClient.TerminateWorkflowAsync(orderId);
-// Raise an event (an incoming purchase order) that your workflow will wait for. This returns the item waiting to be purchased.
-await daprClient.RaiseWorkflowEventAsync(orderId, workflowComponent, workflowName, input);
+// Raise an event (an incoming purchase order) that your workflow will wait for
+await daprWorkflowClient.RaiseEventAsync(orderId, "incoming-purchase-order", input);
// Pause
-await daprClient.PauseWorkflowAsync(orderId, workflowComponent);
+await daprWorkflowClient.SuspendWorkflowAsync(orderId);
// Resume
-await daprClient.ResumeWorkflowAsync(orderId, workflowComponent);
+await daprWorkflowClient.ResumeWorkflowAsync(orderId);
// Purge the workflow, removing all inbox and history information from associated instance
-await daprClient.PurgeWorkflowAsync(orderId, workflowComponent);
+await daprWorkflowClient.PurgeInstanceAsync(orderId);
```
{{% /codetab %}}
@@ -319,8 +318,8 @@ Manage your workflow using HTTP calls. The example below plugs in the properties
To start your workflow with an ID `12345678`, run:
-```http
-POST http://localhost:3500/v1.0/workflows/dapr/OrderProcessingWorkflow/start?instanceID=12345678
+```shell
+curl -X POST "http://localhost:3500/v1.0/workflows/dapr/OrderProcessingWorkflow/start?instanceID=12345678"
```
Note that workflow instance IDs can only contain alphanumeric characters, underscores, and dashes.
@@ -329,16 +328,16 @@ Note that workflow instance IDs can only contain alphanumeric characters, unders
To terminate your workflow with an ID `12345678`, run:
-```http
-POST http://localhost:3500/v1.0/workflows/dapr/12345678/terminate
+```shell
+curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/terminate"
```
### Raise an event
For workflow components that support subscribing to external events, such as the Dapr Workflow engine, you can use the following "raise event" API to deliver a named event to a specific workflow instance.
-```http
-POST http://localhost:3500/v1.0/workflows///raiseEvent/
+```shell
+curl -X POST "http://localhost:3500/v1.0/workflows///raiseEvent/"
```
> An `eventName` can be any function.
@@ -347,14 +346,14 @@ POST http://localhost:3500/v1.0/workflows///r
To plan for down-time, wait for inputs, and more, you can pause and then resume a workflow. To pause a workflow with an ID `12345678` until triggered to resume, run:
-```http
-POST http://localhost:3500/v1.0/workflows/dapr/12345678/pause
+```shell
+curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/pause"
```
To resume a workflow with an ID `12345678`, run:
-```http
-POST http://localhost:3500/v1.0/workflows/dapr/12345678/resume
+```shell
+curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/resume"
```
### Purge a workflow
@@ -363,16 +362,16 @@ The purge API can be used to permanently delete workflow metadata from the under
Only workflow instances in the COMPLETED, FAILED, or TERMINATED state can be purged. If the workflow is in any other state, calling purge returns an error.
-```http
-POST http://localhost:3500/v1.0/workflows/dapr/12345678/purge
+```shell
+curl -X POST "http://localhost:3500/v1.0/workflows/dapr/12345678/purge"
```
### Get information about a workflow
To fetch workflow information (outputs and inputs) with an ID `12345678`, run:
-```http
-GET http://localhost:3500/v1.0/workflows/dapr/12345678
+```shell
+curl -X GET "http://localhost:3500/v1.0/workflows/dapr/12345678"
```
Learn more about these HTTP calls in the [workflow API reference guide]({{< ref workflow_api.md >}}).
diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md
index e19d7331b..78d845150 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-architecture.md
@@ -23,7 +23,7 @@ The Dapr Workflow engine is internally powered by Dapr's actor runtime. The foll
To use the Dapr Workflow building block, you write workflow code in your application using the Dapr Workflow SDK, which internally connects to the sidecar using a gRPC stream. This registers the workflow and any workflow activities, or tasks that workflows can schedule.
-The engine is embedded directly into the sidecar and implemented using the [`durabletask-go`](https://github.com/microsoft/durabletask-go) framework library. This framework allows you to swap out different storage providers, including a storage provider created for Dapr that leverages internal actors behind the scenes. Since Dapr Workflows use actors, you can store workflow state in state stores.
+The engine is embedded directly into the sidecar and implemented using the [`durabletask-go`](https://github.com/dapr/durabletask-go) framework library. This framework allows you to swap out different storage providers, including a storage provider created for Dapr that leverages internal actors behind the scenes. Since Dapr Workflows use actors, you can store workflow state in state stores.
## Sidecar interactions
@@ -31,7 +31,7 @@ When a workflow application starts up, it uses a workflow authoring SDK to send
The workflow app executes the appropriate workflow code and then sends a gRPC request back to the sidecar with the execution results.
-
+
All interactions happen over a single gRPC channel and are initiated by the application, which means the application doesn't need to open any inbound ports. The details of these interactions are internally handled by the language-specific Dapr Workflow authoring SDK.
@@ -91,7 +91,7 @@ Workflow actor state remains in the state store even after a workflow has comple
The following diagram illustrates the typical lifecycle of a workflow actor.
-
+
To summarize:
@@ -113,7 +113,7 @@ Each activity actor stores a single key into the state store:
The following diagram illustrates the typical lifecycle of an activity actor.
-
+
Activity actors are short-lived:
diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md
index 985c1cc11..0adb7059f 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-features-concepts.md
@@ -147,9 +147,9 @@ Learn more about [external system interaction.]({{< ref "workflow-patterns.md#ex
## Workflow backend
-Dapr Workflow relies on the Durable Task Framework for Go (a.k.a. [durabletask-go](https://github.com/microsoft/durabletask-go)) as the core engine for executing workflows. This engine is designed to support multiple backend implementations. For example, the [durabletask-go](https://github.com/microsoft/durabletask-go) repo includes a SQLite implementation and the Dapr repo includes an Actors implementation.
+Dapr Workflow relies on the Durable Task Framework for Go (a.k.a. [durabletask-go](https://github.com/dapr/durabletask-go)) as the core engine for executing workflows. This engine is designed to support multiple backend implementations. For example, the [durabletask-go](https://github.com/dapr/durabletask-go) repo includes a SQLite implementation and the Dapr repo includes an Actors implementation.
-By default, Dapr Workflow supports the Actors backend, which is stable and scalable. However, you can choose a different backend supported in Dapr Workflow. For example, [SQLite](https://github.com/microsoft/durabletask-go/tree/main/backend/sqlite)(TBD future release) could be an option for backend for local development and testing.
+By default, Dapr Workflow supports the Actors backend, which is stable and scalable. However, you can choose a different backend supported in Dapr Workflow. For example, [SQLite](https://github.com/dapr/durabletask-go/tree/main/backend/sqlite)(TBD future release) could be an option for backend for local development and testing.
The backend implementation is largely decoupled from the workflow core engine or the programming model that you see. The backend primarily impacts:
- How workflow state is stored
@@ -232,7 +232,7 @@ Do this:
// Do this!!
DateTime currentTime = context.CurrentUtcDateTime;
Guid newIdentifier = context.NewGuid();
-string randomString = await context.CallActivityAsync("GetRandomString");
+string randomString = await context.CallActivityAsync(nameof("GetRandomString")); //Use "nameof" to prevent specifying an activity name that does not exist in your application
```
{{% /codetab %}}
@@ -339,7 +339,7 @@ Do this:
```csharp
// Do this!!
string configuration = workflowInput.Configuration; // imaginary workflow input argument
-string data = await context.CallActivityAsync("MakeHttpCall", "https://example.com/api/data");
+string data = await context.CallActivityAsync(nameof("MakeHttpCall"), "https://example.com/api/data");
```
{{% /codetab %}}
@@ -439,7 +439,7 @@ Do this:
```csharp
// Do this!!
-Task t = context.CallActivityAsync("DoSomething");
+Task t = context.CallActivityAsync(nameof("DoSomething"));
await context.CreateTimer(5000).ConfigureAwait(true);
```
diff --git a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md
index 6fe74a756..93c02d60b 100644
--- a/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md
+++ b/daprdocs/content/en/developing-applications/building-blocks/workflow/workflow-patterns.md
@@ -624,6 +624,29 @@ await context.CallActivityAsync("PostResults", sum);
{{< /tabs >}}
+With the release of 1.16, it's even easier to process workflow activities in parallel while putting an upper cap on
+concurrency by using the following extension methods on the `WorkflowContext`:
+
+{{< tabs ".NET" >}}
+
+{{% codetab %}}
+
+```csharp
+//Revisiting the earlier example...
+// Get a list of work items to process
+var workBatch = await context.CallActivityAsync