Skip to content

feat(#94): add getClientVersion, getServerProtocol and network thread completion hook - #104

Merged
s2x merged 1 commit into
masterfrom
feat/94-client-introspection
Sep 9, 2026
Merged

feat(#94): add getClientVersion, getServerProtocol and network thread completion hook#104
s2x merged 1 commit into
masterfrom
feat/94-client-introspection

Conversation

@s2x

@s2x s2x commented Sep 9, 2026

Copy link
Copy Markdown
Member

Closes #94

Changes

  • FoundationDB::getClientVersion(): string — version/build of the loaded libfdb_c (fdb_get_client_version)
  • Database::getServerProtocol(): int — cluster protocol version (fdb_database_get_server_protocol), resolved through the new FutureUInt64 future type binding fdb_future_get_uint64
  • FoundationDB::onNetworkThreadCompletion(callable): void — completion hook invoked once from NativeClient::stopNetwork() after the network thread has been joined. The native fdb_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

  • Unit: FutureUInt64Test (stub-library FFI exercise of fdb_future_get_uint64), NativeClientCompletionHookTest (hooks run once, FIFO, consumed, not run before stop)
  • Integration: DatabaseMonitoringTest (getClientVersion non-empty, getServerProtocol > 0), NetworkLifecycleTest (hook runs exactly once on stop, in a separate process)

Docs

  • docs/advanced.md — Database Monitoring section extended

Changelog

  • [#94] entry added under Unreleased → Added

CI: composer lint and composer test:unit clean locally; full integration suite (242 tests) green against the 5-node Docker cluster.

@s2x
s2x merged commit b004291 into master Sep 9, 2026
6 checks passed
@s2x
s2x deleted the feat/94-client-introspection branch September 9, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add client/cluster introspection: getClientVersion, getServerProtocol, network thread completion hook

1 participant