feat(examples): in-library chronos CBOR IPC server + cross-platform CI#68
Draft
Ivansete-status wants to merge 1 commit into
Draft
feat(examples): in-library chronos CBOR IPC server + cross-platform CI#68Ivansete-status wants to merge 1 commit into
Ivansete-status wants to merge 1 commit into
Conversation
Adds a standalone IPC example: the library serving itself over a CBOR socket. examples/timer/ipc_chronos/serve.nim compiles into libmy_timer only under -d:ffiIpcServe (every other build untouched) and runs a chronos socket server that, per request, decodes CBOR at the socket edge and calls the library's own async procs directly — native, in-process, zero serialization between the socket and the logic, no FFI boundary, no callback bridge. Exposed as my_timer_serve(address). CBOR (not the native struct ABI) is correct at the wire here: a relay's data is serialized regardless, so native would only relocate the decode and add marshalling for no gain — native locally, CBOR for IPC. serve_host.nim starts it; client.nim is a lib-free chronos client. Both use chronos sockets, so the example builds and runs on Linux, macOS and Windows over TCP (unix sockets are a POSIX bonus). CI: tests/e2e/ipc/run_roundtrip.nim builds the dylib + host + client, spawns the server and round-trips over loopback TCP asserting the replies; wired as `nimble test_ipc` and a 3-OS CI matrix (ubuntu/macos/windows). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ivansete-status
force-pushed
the
ipc-chronos-server
branch
from
June 1, 2026 06:43
a557c65 to
db46bb9
Compare
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.
What
A standalone IPC example: the library serving itself over a CBOR socket, plus the automated cross-platform validation it needs. Self-contained on
master(no dependency on the native-ABI stack) inexamples/timer/ipc_chronos/.serve.nimcompiles intolibmy_timeronly under-d:ffiIpcServe(every other build untouched) and runs a chronos socket server that, per request, decodes CBOR at the socket edge and calls the library's own async procs directly — native, in-process, zero serialization between the socket and the logic. No FFI boundary, no callback bridge: the server is the library. Exposed asmy_timer_serve(address).Why CBOR at the wire (not the native struct ABI): a relay's data is serialized regardless, so native would only relocate the decode and add marshalling for no gain — native locally, CBOR for IPC.
Portable
serve_host.nimstarts it;client.nimis a lib-free chronos client. Both use chronos sockets, so the example builds and runs on Linux, macOS and Windows over TCP (unix sockets are a POSIX bonus).CI
tests/e2e/ipc/run_roundtrip.nimbuilds the dylib + host + client, spawns the server and round-trips over loopback TCP asserting the replies — wired asnimble test_ipcand a 3-OS CI matrix (ubuntu/macos/windows). Closes the gap where the IPC story had no automated validation.Validated locally on macOS; the matrix exercises Linux/Windows.
🤖 Generated with Claude Code