docs: correct Event class description in event-based-asynchronous README by 1wu-davy-2 · Pull Request #3624 · iluwatar/java-design-patterns · GitHub
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

@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

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