Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: restructure client eval #2362

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
resolver = "2"
members = ["./client/engine"]
members = ["./sdk/client/engine"]
File renamed without changes.
6 changes: 4 additions & 2 deletions client/engine/Cargo.toml → sdk/client/engine/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[package]
name = "engine"
version = "0.1.0"
name = "flipt-client-engine"
version = "0.0.1"
edition = "2021"
authors = ["Flipt Devs <[email protected]>"]
license = "MIT"

[dependencies]
libc = "0.2.150"
Expand Down
33 changes: 33 additions & 0 deletions sdk/client/engine/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Flipt Client Engine

![Status: Experimental](https://img.shields.io/badge/status-experimental-yellow)

This is the client engine for Flipt. It is responsible for evaluating context provided by the native language client SDKs and returning the results of the evaluation.

## Architecture

The client engine is a Rust library responsible for evaluating context and returning the results of the evaluation. The client engine polls for evaluation state from the Flipt server and uses this state to determine the results of the evaluation. The client engine is designed to be embedded in the native language client SDKs. The native language client SDKs will send context to the client engine via [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) and receive the results of the evaluation from engine.

This design allows for the client evaluation logic to be written once in a memory safe language and embedded in the native language client SDKs. This design also allows for the client engine to be updated independently of the native language client SDKs.

TODO: Diagram

## Development

TODO: Add more details

### Prerequisites

- [Rust](https://www.rust-lang.org/tools/install)

### Build

```bash
cargo build
```

### Test

```bash
cargo test
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading