Skip to content

refactor: implement runLater functionality with event handling instead of long polling#1041

Merged
hyyan merged 2 commits into
mainfrom
runlater-events
Jul 10, 2025
Merged

refactor: implement runLater functionality with event handling instead of long polling#1041
hyyan merged 2 commits into
mainfrom
runlater-events

Conversation

@hyyan

@hyyan hyyan commented Jul 10, 2025

Copy link
Copy Markdown
Member

No description provided.

@hyyan hyyan added this to the 25.02 milestone Jul 10, 2025
@hyyan hyyan added the Type: Refactor This issue requires refactoring and might introduce a breaking change label Jul 10, 2025
@github-actions github-actions Bot added the module: foundation The change is in the foundation module label Jul 10, 2025
@github-actions

github-actions Bot commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@hyyan hyyan requested a review from Copilot July 10, 2025 10:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the runLater functionality by replacing the long polling mechanism with event-driven handling for processing background thread requests. The changes improve efficiency by eliminating the need for continuous polling.

  • Replaces timer-based polling with custom event posting and handling
  • Changes request IDs from integers to strings for better uniqueness
  • Adds proper event callback registration and cleanup

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
EnvironmentRunLaterEventHandler.java New event handler class for processing runLater custom events
EnvironmentAccessRequest.java Changes request ID type from int to String
Environment.java Refactors runLater implementation to use event posting instead of polling timer
EnvironmentRunLaterTest.java Updates tests to cover new event-driven functionality and edge cases

Comment thread webforj-foundation/src/test/java/com/webforj/EnvironmentRunLaterTest.java Outdated
Comment thread webforj-foundation/src/main/java/com/webforj/Environment.java
Comment thread webforj-foundation/src/main/java/com/webforj/Environment.java
Comment thread webforj-foundation/src/main/java/com/webforj/Environment.java
Comment thread webforj-foundation/src/main/java/com/webforj/Environment.java
Comment thread webforj-foundation/src/main/java/com/webforj/Environment.java
@github-actions

github-actions Bot commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 75.59% -0.11% 🍏
Files changed 70.31% 🍏

Module Coverage
webforj-foundation 73.09% -0.15% 🍏
Files
Module File Coverage
webforj-foundation EnvironmentAccessRequest.java 85.71% 🍏
Environment.java 76.87% -11.15% 🍏
EnvironmentRunLaterEventHandler.java 40% -60%

…erTest.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@hyyan hyyan merged commit 3714e12 into main Jul 10, 2025
7 checks passed
@hyyan hyyan deleted the runlater-events branch July 10, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: foundation The change is in the foundation module Type: Refactor This issue requires refactoring and might introduce a breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants