fullstorydev / grpchan

Channels for gRPC: custom transports
MIT License
204 stars 23 forks source link

grpchan should support pluggable codecs #40

Closed dragonsinth closed 3 years ago

dragonsinth commented 4 years ago

Support user pluggable codecs based on content type. This allows (for example) for JSON based HTTP support.

dragonsinth commented 4 years ago

Hmm, we could potentially open source proto -> typescript gen.

dragonsinth commented 4 years ago

We should probably ruminate on this more to find an acceptable form we could land this capability in.

jhump commented 4 years ago

We should probably ruminate on this more to find an acceptable form we could land this capability in.

I bet we could add some hooks/options to the creation of the HTTP channel -- like a callback that lets an option provide the unmarshaler to use for a given set of request headers and a marshaler that marshals to bytes but also decides the content-type to send. Then we could unfork the repo and leave these customizations out of this repo and just in our internal one.

dragonsinth commented 3 years ago

PTAL-- although maybe we should rename this "grpchan should support pluggable encodings"

jhump commented 3 years ago

I think this looks great for our use. But I still don't think it's ready for master. For one: it does not attempt to do anything with regards to streams. For two: it still references "grpc-web", even though the format/protocol that httpgrpc uses is not like grpc-web.

But we can leave it as an open PR until such time as we feel like fleshing out those other things.

dragonsinth commented 3 years ago

I think this looks great for our use. But I still don't think it's ready for master. For one: it does not attempt to do anything with regards to streams.

Should I try adding that?

For two: it still references "grpc-web", even though the format/protocol that httpgrpc uses is not like grpc-web.

It doesn't, I ripped this out. It's totally generic now.

dragonsinth commented 3 years ago

Okay, I added stream support.