WW-1742 docs(execAndWait): document token-scoped background process naming - #1861
Merged
Merged
Conversation
…aming The request was for the framework to ship a TokenizedExecuteAndWaitInterceptor so that several browser tabs of one session can run the same action in the background. The hook that makes this possible already exists - WW-1740 added getBackgroundProcessName(ActionProxy) - so the capability is reachable in a few lines; what was missing is that nobody wrote it down. Document the override in the interceptor's "extending" snippet, including the two caveats that make shipping it as the default a bad trade: session entries are only reclaimed when a request observes the process as done, so a per-token key grows unboundedly with abandoned runs, and a wait page that does not propagate the token starts a new background process on every refresh. Add a test covering both keyings: the action-name default shares one process across tabs, the documented override gives each tab its own. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes WW-1742
Background
WW-1742 (filed 2007) asked Struts to ship a
TokenizedExecuteAndWaitInterceptorso that several browser tabs of the same session could each run the same action in the background, instead of the second tab joining the process the first one started.The dependency it was waiting on has long since landed: WW-1740 added the
getBackgroundProcessName(ActionProxy)hook, and WW-1741 made the interceptor re-set the session token before returningwait. The capability is therefore already reachable in a handful of lines — the attached patch is just no longer applicable, because it overridesgetName(ActionInvocation), a method that no longer exists.What is missing is documentation, not a framework hook.
Why not ship the class
Two properties make a token-keyed default a bad trade:
execAndWaitactions; with a per-token key every abandoned run strands aBackgroundProcess— and the action instance it holds — in the session, unbounded.What this PR does
extendingjavadoc snippet (the one rendered on the site), with the sample class and both caveats spelled out.ExecuteAndWaitInterceptorTokenScopeTest, covering both keyings: two tabs share one process under the action-name default, and get one process each under the documented override. The second test also guards the hook itself against being renamed again, which is what invalidated the original patch.No behaviour change.
Testing
2 + 8 tests, 0 failures.
mvn -pl core javadoc:javadocis clean.🤖 Generated with Claude Code