Hi all, I am wondering if anyone has had some experience writing a GRPC client and/or server using the ProtoBuf.jl and HTTP.jl packages (both of which appear to be in good working order for 1.0). I found an old GRPC.jl package, but it relies on HTTP2.jl which doesn’t appear to have been updated in some time.
Protobuf.jl has an example of writing an RPC client and server (using tcp sockets) (https://github.com/JuliaIO/ProtoBuf.jl/blob/master/test/services/testsvc.jl), so I’d like to model what I’m doing off of that (except using HTTP requests instead). The problem is I can’t quite figure out how to get the functionality of creating an HTTP connection session object that I can interact with in HTTP.jl. For example, this is some of the older code in the GRPC.jl library (again relying on HTTP2.jl):
function write_request(channel::gRPCChannel, controller::gRPCController, service::ServiceDescriptor, method::MethodDescriptor, request) connection = channel.session path = "/" * service.name * "/" * method.name headers = Headers(":method" => "POST", ":path" => path, ":scheme" => "http", "content-type" => "application/grpc+proto") channel.stream_id = Session.next_free_stream_identifier(connection) debug_log(controller, "Stream Id: $(channel.stream_id)") Session.put_act!(connection, Session.ActSendHeaders(channel.stream_id, headers, false)) data_buff = to_delimited_message_bytes(request) Session.put_act!(channel.session, Session.ActSendData(channel.stream_id, data_buff, true)) debug_log(controller, "sent data $(length(data_buff)) bytes") nothing end
It is interacting with this HTTP session object. What would be the best way to fit such functionality in the newer HTTP.jl paradigm?