memphis
memphis copied to clipboard
Feature: C Client
Current behavior
Add an officially supported C client. This would enable any language that supports the C ABI to create bindings e.g. C++, Zig, ...
Suggested solution
No response
Additional context
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Contributing Docs
- [X] I agree to follow this project's Contribution Docs
Hey @rupurt, Thanks for the request. Adding it to the "future discussion" board.
Hey @rupurt, could you please add short description of required flows? (this is also a check that you still need this functionality)
i am thinking about possibility to add gRPC access to memphis it will allow to generate code of the client side and as far as i understand c++ is supported by gRPC i am not sure regarding C :-(
I am looking for a C++ SDK. gRPC would definitely solve produce and consume but would probably not work for other SDK functions like creating a station.
I started on compiling the go SDK as a c library and building a C++ wrapper around it. It worked for simple string consume and produce. I haven't had time to dive deeper into all functions, e.g. protobuf or json.
I'd like to clarify proposed solution:
- proto files - definitions of structures and apis
- generation of go code for client and server
- implementation of go based gRPC server process (memphis bridge)
- receive grpc "requests"
- "translates" to memphis
- this process runs as stand alone or as part of memphis containers
- you can generate C++/PHP/etc client code and use it in own application
see grpcadapter repo
Supported APIs:
service AdapterService {
rpc CreateStation(CreateStationRequest) returns (Status) {}
rpc DestroyStation(DestroyStationRequest) returns (Status) {}
rpc Produce(stream ProduceMessages) returns (Status) {}
rpc Consume(stream ConsumeMessages) returns (stream ConsumeResponse) {}
}
see proto files