Improve Documentation in Code #24

Merged
kske merged 2 commits from f/improved-documentation into develop 2021-11-01 21:48:51 +01:00
2 changed files with 4 additions and 3 deletions
Showing only changes of commit 872b395374 - Show all commits

View File

@ -75,14 +75,15 @@ public final class EventBus {
private final Map<Class<?>, TreeSet<EventHandler>> bindings = new ConcurrentHashMap<>();
/**
* Registered listeners.
* Stores all registered event listeners (which declare event handlers) and prevents them from
* being garbage collected.
*
* @since 0.0.1
*/
private final Set<Object> registeredListeners = ConcurrentHashMap.newKeySet();
/**
kske marked this conversation as resolved
Review

The current event dispatching state for the current thread.

The current event dispatching state for the current thread.
* Thread-local dispatch state.
* The current event dispatching state, local to each thread.
*
* @since 0.1.0
*/

View File

@ -4,7 +4,7 @@ package dev.kske.eventbus.core;
* This unchecked exception is specific to the event bus and can be thrown under the following
Review

I think it would be kinda funny to have an EventBusException that can be thrown under (the bus and) the following…

I think it would be kinda funny to have an `EventBusException` that `can be thrown under (the bus and) the following…`
* circumstances:
* <ul>
* <li>An event handler throws an exception (which is stores as the cause)</li>
* <li>An event handler throws an exception (which is stored as the cause)</li>
* <li>An event listener with an invalid event handler is registered</li>
* <li>{@link EventBus#cancel()} is invoked from outside an active dispatch thread</li>
* </ul>