Skip to content

refactor: define new Synchronizer and Initializer interfaces for FDv2#517

Merged
beekld merged 10 commits intomainfrom
beeklimt/SDK-2096
Apr 3, 2026
Merged

refactor: define new Synchronizer and Initializer interfaces for FDv2#517
beekld merged 10 commits intomainfrom
beeklimt/SDK-2096

Conversation

@beekld
Copy link
Copy Markdown
Contributor

@beekld beekld commented Apr 2, 2026

This PR introduces IFDv2Initializer and IFDv2Synchronizer interfaces.

I based this on the Java design, but with some significant changes:

FDv2SourceResult Next(std::chrono::milliseconds timeout,
                      data_model::Selector selector) 
  1. I made this a blocking call with a timeout, because C++ doesn't have any equivalent to "anyOf" for waiting on multiple racing promises, and this was the cleanest alternative I could come up with.
  2. It doesn't have the same "conditions" structure as Java, but it seems like that's only used to implement timeouts, so I think we don't need it, unless I missed something.
  3. Rather than introduce a SelectorProvider interface for the initializers/synchronizers to use, I am passing the selector directly into Next. I think this is acceptable, as Next only return a single result, which I think will only use one selector. This avoids having to deal with the ownership complications a shared provider would entail.

Note

Low Risk
Low risk because it only adds new FDv2 interface headers and a result type without changing existing runtime behavior; main risk is future integration/implementation mismatches around the blocking Next() timeout/selector contract.

Overview
Introduces new FDv2 source abstractions for the server SDK: a one-shot IFDv2Initializer (blocking Run() + Close()) and a continuous IFDv2Synchronizer with a blocking Next(timeout, selector) API.

Adds FDv2SourceResult as a unified variant return type covering successful changesets, transient/terminal errors, shutdown, goodbye/rotation signals, and timeout-based wakeups (including an fdv1_fallback flag where applicable). Also updates .gitignore to ignore .cache.

Written by Cursor Bugbot for commit ed22857. This will update automatically on new commits. Configure here.

@beekld beekld requested a review from a team as a code owner April 2, 2026 17:54
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

*/
struct Timeout {};

using Value = std::variant<ChangeSet, Interrupted, TerminalError, Shutdown,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nicer than the Java shenanigans.

@beekld beekld merged commit 884b394 into main Apr 3, 2026
44 checks passed
@beekld beekld deleted the beeklimt/SDK-2096 branch April 3, 2026 16:45
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.

2 participants