feat: implement futures to better handle async IPC & probes#131
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a small “Future” abstraction to support non-blocking IPC operations (notably endpoint probing), adds configurable IPC dispatch/probe timeouts, and upgrades probe reporting to include status/latency and DNS resolution details.
Changes:
- Add
Future[T]+ dispatch-based futures to coordinate async work between IPC handling and the main dispatch loop. - Extend the IPC probe API to support per-request timeouts and return structured probe results (status, resolved endpoint, latency).
- Add integration + e2e coverage for probe timeout/resolve/latency behavior, and update the
nylon probeCLI to accept--timeout.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
state/tunables.go |
Adds IPCDispatchTimeout tunable and sets a default. |
protocol/nylon_ipc.proto |
Extends probe request/response schema (timeout + richer result fields). |
protocol/nylon_ipc.pb.go |
Regenerated IPC protobuf bindings to reflect schema changes. |
integration/ipc_test.go |
Adds integration test ensuring probe timeouts are reported. |
e2e/probe_test.go |
Adds e2e tests for resolved DNS, latency reporting, and error/timeout statuses. |
core/nylon_scheduler.go |
Adds NewDispatchFuture helper for dispatch-thread async work. |
core/nylon_endpoints.go |
Refactors probing to return futures and report status/latency/resolution. |
core/ipc_handler.go |
Reworks IPC probe handling to use futures + timeouts; adds timeout constants. |
core/ipc_handler_test.go |
Adds unit test for probe timeout calculation/capping. |
core/future.go |
Introduces Future[T] and AwaitAll. |
core/future_test.go |
Adds unit tests for future single-consumption, ordering, and timeout. |
cmd/probe.go |
Adds --timeout flag and prints richer probe output (status/resolved/latency). |
Files not reviewed (1)
- protocol/nylon_ipc.pb.go: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.