-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
CC++cross-platformenhancementNew feature or requestNew feature or requestgrpcgRPCgRPCpackagingserver
Description
Replace Scala server with C/C++ server
Summary
The current gRPC server is implemented in Scala (Pekko), which adds a JVM runtime dependency and a third build/test/package system. We want to replace the Scala middleware with a cross-platform C/C++ gRPC server that directly bridges to the core native library, reducing complexity and deployment friction.
Motivation
- Reduce language/toolchain count (Scala/JVM stack removal).
- Eliminate JRE requirement on target systems.
- Simplify packaging and distribution (single native server per platform).
- Improve operational consistency with the native core library.
Goals
- Provide a fully functional C/C++ gRPC server implementing all RPCs in proto/omega_edit.proto.
- Preserve existing behavior and API compatibility with clients.
- Support cross-platform builds (Linux/macOS/Windows).
- Replace Tika-based file type detection with Apache-2.0 compatible libraries.
- Maintain current event streaming semantics for sessions and viewports.
Non-Goals
- Redesign of the gRPC API.
- Changes to core library public APIs.
- Client protocol changes.
- New feature work unrelated to the server migration.
Dependencies and Licensing
All new dependencies must be compatible with Apache-2.0.
Proposed replacements:
- Content type detection:
libmagic(BSD-2-Clause) using the magic database. - Language detection:
cld3(Apache-2.0). - Encoding/BOM: continue using existing core BOM detection.
Proposed Implementation Plan
-
Scaffold C/C++ gRPC server
- Create
server/cppmodule with CMake build. - Generate gRPC stubs from proto/omega_edit.proto.
- Add CI build target for the new server.
- Create
-
Implement RPC handlers
- Map all service methods to the native core APIs:
- Sessions, changes, viewports, search, counts, metadata.
- Map all service methods to the native core APIs:
-
Event streaming
- Use session and viewport callbacks from core (
omega_session_event_cbk_t,omega_viewport_event_cbk_t). - Implement subscription management and backpressure-safe queues.
- Use session and viewport callbacks from core (
-
Replace Tika functionality
- Add C++ wrappers for file type and language detection.
- Integrate in
GetContentTypeandGetLanguagehandlers.
-
Packaging and distribution
- Produce platform-specific native server binaries.
- Update
packages/serverto bundle the native server instead of the Scala server.
-
Parity validation
- Run existing client tests against both servers.
- Add explicit gRPC parity test suite if needed.
Acceptance Criteria
- All gRPC endpoints pass existing test suites.
- Node client can use the new server without code changes.
- CI builds the native server on Linux/macOS/Windows.
- No JVM runtime dependency for the server package.
- All dependencies verified Apache-2.0 compatible.
Risks
- Feature parity with the Scala server event stream semantics.
- Threading/concurrency differences between Scala and C++.
- Packaging complexity for gRPC C++ runtime on Windows.
Notes
- Keep Scala server temporarily for parity comparison until C++ server is production-ready.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CC++cross-platformenhancementNew feature or requestNew feature or requestgrpcgRPCgRPCpackagingserver
Type
Projects
Status
Todo