Skip to content

feat: Add C bindings for Redis Big Segments store#574

Open
beekld wants to merge 1 commit into
beeklimt/SDK-2529/big-segments-c-bindingsfrom
beeklimt/SDK-2628/redis-big-segments-c-binding
Open

feat: Add C bindings for Redis Big Segments store#574
beekld wants to merge 1 commit into
beeklimt/SDK-2529/big-segments-c-bindingsfrom
beeklimt/SDK-2628/redis-big-segments-c-binding

Conversation

@beekld

@beekld beekld commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a C binding for RedisBigSegmentStore so C callers can wire the existing Redis Big Segments integration into the SDK's Big Segments config.

New public surface:

  • LDServerBigSegmentsRedisStore opaque handle.
  • struct LDServerBigSegmentsRedisResult with store and error_message fields.
  • LDSERVER_BIGSEGMENTS_REDISSTORE_ERROR_MESSAGE_SIZE macro.
  • LDServerBigSegmentsRedisStore_New(uri, prefix, out_result) factory.
  • LDServerBigSegmentsRedisStore_Free(store).

Tests:

  • Unit tests for successful creation, failure error propagation, and null-store on failure.
  • End-to-end test against a live Redis: primes a sync timestamp, wires the store through the C API, and verifies the SDK reports the store available via the Big Segment status listener.

Design decision worth flagging: the type name uses config-section-first word order (BigSegments + Redis + Store) to mirror the existing Redis LazyLoad C binding's LDServerLazyLoadRedisSource (LazyLoad + Redis + Source). This differs from the C++ class name RedisBigSegmentStore -- a literal C++ mirror would have been LDServerRedisBigSegmentStore. Chose consistency with the sibling C binding in the same header directory over C++ class-name parity.

Stacked on #573 (Big Segments C bindings). Please review that PR first.


Note

Low Risk
New public C API and thin wrapper around existing C++ store logic; no changes to core flag evaluation or auth paths.

Overview
Exposes a C API for the existing Redis-backed Big Segments store so C callers can plug it into LDServerBigSegmentsBuilder the same way the Lazy Load Redis binding works for data sources.

The new surface includes an opaque LDServerBigSegmentsRedisStore handle, a stack-allocated LDServerBigSegmentsRedisResult (store pointer plus fixed-size error_message), and LDServerBigSegmentsRedisStore_New / _Free. The implementation delegates to RedisBigSegmentStore::Create and documents that the SDK may take ownership instead of calling _Free. The redis-source library build now compiles bindings/redis/redis_big_segment_store.cpp.

Tests cover create/free and failure paths (non-empty error, null store), plus an integration test that seeds Redis sync metadata, wires the store through the C Big Segments config, and waits on the Big Segment store status listener until available.

Reviewed by Cursor Bugbot for commit c0acca8. Bugbot is set up for automated code reviews on this repo. Configure here.

@beekld beekld force-pushed the beeklimt/SDK-2529/big-segments-c-bindings branch from a42553c to bb517aa Compare July 1, 2026 18:56
@beekld beekld force-pushed the beeklimt/SDK-2628/redis-big-segments-c-binding branch from 2ce9c92 to e06f24a Compare July 1, 2026 19:06
@beekld beekld force-pushed the beeklimt/SDK-2529/big-segments-c-bindings branch from bb517aa to 2f888ea Compare July 1, 2026 23:43
@beekld beekld force-pushed the beeklimt/SDK-2628/redis-big-segments-c-binding branch from e06f24a to c0acca8 Compare July 1, 2026 23:45
@beekld beekld marked this pull request as ready for review July 2, 2026 00:08
@beekld beekld requested a review from a team as a code owner July 2, 2026 00:08
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.

1 participant