Skip to content

docs: correct Event class description in event-based-asynchronous README - #3624

Open
1wu-davy-2 wants to merge 1 commit into
iluwatar:masterfrom
1wu-davy-2:docs/fix-event-based-asynchronous-readme
Open

1wu-davy-2 wants to merge 1 commit into
iluwatar:masterfrom
1wu-davy-2:docs/fix-event-based-asynchronous-readme

Conversation

@1wu-davy-2

Copy link
Copy Markdown

Description

The README claimed that Event is an abstract class with two concrete subclasses, AsyncEvent and SyncEvent. Neither statement matches the code:

  • Event is an interface declaring start(), stop() and status().
  • There is no SyncEvent class. The only implementation is AsyncEvent, which carries a synchronous flag.
  • EventManager.createEvent(Duration, boolean isSynchronous) builds new AsyncEvent(id, time, isSynchronous) for both kinds, so synchronous and asynchronous events are the same class.
  • AsyncEvent.start() always spawns its own thread, so a synchronous event does not "run on the main thread and block it". The real distinction is that EventManager permits only one synchronous event at a time, tracked by the currentlyRunningSyncEvent field.

The createAsync and create snippets were also replaced with the actual implementations.

Checklist

  • Only documentation change (event-based-asynchronous/README.md)
  • Statements and snippets verified against Event.java, AsyncEvent.java and EventManager.java
  • No remaining reference to SyncEvent as a class, or to Event as an abstract class

Assisted by AI tools for initial analysis; all changes manually verified and tested.

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

PR Summary

Updated the README to reflect the actual Event design. It now describes Event as an interface with start(), stop() and status(); clarifies that AsyncEvent is the only implementation (carrying a synchronous flag) and that both synchronous and asynchronous events are created via EventManager.createEvent(Duration, boolean isSynchronous). The code snippets for createAsync and create were updated to their actual implementations and it is explained that only one synchronous event can run at a time, tracked by currentlyRunningSyncEvent.

Changes

File Summary
event-based-asynchronous/README.md Reworded the README to reflect that Event is an interface; removed references to a SyncEvent class and stated that AsyncEvent is the sole implementation (carrying a synchronous flag). Updated snippets to show EventManager.createEvent(...) usage, including createAsync and create signatures, and clarified that only one synchronous event may run at a time via currentlyRunningSyncEvent.

autogenerated by presubmit.ai

@github-actions github-actions Bot 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.

✅ LGTM!

Review Summary

Commits Considered (1)
  • 8de76a0: docs: correct Event class description in event-based-asynchronous README
Files Processed (1)
  • event-based-asynchronous/README.md (4 hunks)
Actionable Comments (0)
Skipped Comments (4)
  • event-based-asynchronous/README.md [44-49]

    readability: "Clarify event abstraction and synchronization model"

  • event-based-asynchronous/README.md [75-78]

    readability: "Explain createAsync wrapper and its relation to AsyncEvent"

  • event-based-asynchronous/README.md [80-82]

    readability: "Terminology consistency (runtime vs. eventTime)"

  • event-based-asynchronous/README.md [151-152]

    readability: "Clarify lifecycle of synchronous event tracking"

@codecov

codecov Bot commented Oct 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.01%. Comparing base (4cabb20) to head (8de76a0).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3624      +/-   ##
============================================
- Coverage     84.06%   84.01%   -0.06%     
+ Complexity     4353     4349       -4     
============================================
  Files          1133     1133              
  Lines         15400    15400              
  Branches        739      739              
============================================
- Hits          12946    12938       -8     
- Misses         2158     2164       +6     
- Partials        296      298       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant