You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2023/03/02 16:05:32 UTC

[struts-site] 01/01: WW-3691 Documents how to use ExecutorProvider

This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch WW-3691-executor
in repository https://gitbox.apache.org/repos/asf/struts-site.git

commit d1f95c6bf03e3a1f67506bade403c393af9fd410
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Thu Mar 2 17:05:19 2023 +0100

    WW-3691 Documents how to use ExecutorProvider
---
 .../core-developers/execute-and-wait-interceptor.md   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/source/core-developers/execute-and-wait-interceptor.md b/source/core-developers/execute-and-wait-interceptor.md
index 9bf87ebef..12ece0a26 100644
--- a/source/core-developers/execute-and-wait-interceptor.md
+++ b/source/core-developers/execute-and-wait-interceptor.md
@@ -7,6 +7,10 @@ parent:
 ---
 
 # Execute and Wait Interceptor
+{:.no_toc}
+
+* Will be replaced with the ToC, excluding a header
+{:toc}
 
 The ExecuteAndWaitInterceptor is great for running long-lived actions in the background while showing the user a nice
 progress meter. This also prevents the HTTP request from timing out when the action takes more than 5 or 10 minutes.
@@ -61,6 +65,21 @@ for obtaining and releasing resources that the background process will need to e
 background
 process extension, extend `ExecuteAndWaitInterceptor` and implement the `getNewBackgroundProcess()` method.
 
+## Using ExecutorProvider
+
+Since Struts 6.1.1 it is possible to use your own `ExecutorProvider` to run _background tasks_. To use your own executor
+you must implement interface `org.apache.struts2.interceptor.exec.ExecutorProvider` and install the bean using `struts.xml`
+like follows:
+
+```xml
+<bean type="org.apache.struts2.interceptor.exec.ExecutorProvider" 
+      class="com.company.MyExecutorProvider"/>
+```
+
+Please a take look into example implementation in the Showcase App.
+
+If now custom executor is defined, Struts will use `org.apache.struts2.interceptor.exec.StrutsExecutorProvider` by default.
+
 ## Examples
 
 ### Example code 1