feat(#94): add getClientVersion, getServerProtocol and network thread completion hook - #104
Merged
Merged
Conversation
7 tasks
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.
Closes #94
Changes
FoundationDB::getClientVersion(): string— version/build of the loadedlibfdb_c(fdb_get_client_version)Database::getServerProtocol(): int— cluster protocol version (fdb_database_get_server_protocol), resolved through the newFutureUInt64future type bindingfdb_future_get_uint64FoundationDB::onNetworkThreadCompletion(callable): void— completion hook invoked once fromNativeClient::stopNetwork()after the network thread has been joined. The nativefdb_add_network_thread_completion_hook()API is deliberately not used for PHP callables: native hooks run on the FDB network thread, where PHP execution is unsafe. The deferred invocation preserves the ordering guarantee (network thread already finished).Tests
FutureUInt64Test(stub-library FFI exercise offdb_future_get_uint64),NativeClientCompletionHookTest(hooks run once, FIFO, consumed, not run before stop)DatabaseMonitoringTest(getClientVersion non-empty, getServerProtocol > 0),NetworkLifecycleTest(hook runs exactly once on stop, in a separate process)Docs
docs/advanced.md— Database Monitoring section extendedChangelog
[#94]entry added under Unreleased → AddedCI:
composer lintandcomposer test:unitclean locally; full integration suite (242 tests) green against the 5-node Docker cluster.