product: rebuild as Sky Java Event Bus - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:dc21f018d8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private static void publishesInSubscriptionOrder() throws Exception { | ||
| var bus = new EventBus(); | ||
| var seen = new ArrayList<String>(); | ||
| try (var first = bus.subscribe("orders.created", event -> seen.add("first:" + event.payload())); |
There was a problem hiding this comment.
Keep the test harness warning-free under
-Werror
The first resource is never referenced inside the try body, so the workflow's javac -Xlint:all -Werror test compilation emits [try] auto-closeable resource first is never referenced and fails before any tests run; the other three resource declarations have the same problem. javac --help-lint describes try as warning about try-with-resources issues, so these handles need to be referenced or the specific warning suppressed.
Useful? React with 👍 / 👎.
| if (handlers.size() >= MAX_SUBSCRIBERS_PER_TOPIC) { | ||
| throw new IllegalStateException("subscriber capacity reached for topic"); | ||
| } | ||
| handlers.add(consumer); |
There was a problem hiding this comment.
Make the subscriber capacity check atomic
With 99 handlers already registered, two concurrent subscribe calls can both observe a size below 100 and then both append, leaving 101 handlers; this is reproducible against this commit. CopyOnWriteArrayList only makes the individual operations thread-safe, so the check-then-add sequence defeats the documented hard resource cap during concurrent registration and should be performed atomically.
Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.
Next non-overlapping standalone product in the SKYCOIN4444 portfolio loop.
This branch replaces the mislabeled Python placeholder with a real dependency-free Java 21 event bus: bounded events/topics/attributes/payloads, concurrent topic registry, deterministic synchronous subscriber order, explicit unsubscribe handles, subscriber-failure isolation, metrics, hard topic/subscriber caps, a dependency-free test harness, strict javac warnings-as-errors gates, runnable JAR smoke testing, and non-root container packaging.
Status: engineering beta. This is an in-process JVM primitive, not Kafka/NATS/RabbitMQ, a durable queue/log, transactional outbox, exactly-once system, distributed broker, authentication layer, HA service, or production deployment.
Merge only after the exact PR head passes all declared CI gates.