For large files, could you send a first request without any chunks, so that
the server gets all the parameters first? Then the rest of the stream would
be requests with just chunks that could you process progressively, as they
come in.

For small files, you'd just send a stream with one request that has both
the single chunk and the parameters.

On Tue, Apr 10, 2018 at 5:39 PM, Weidong Lian <weidong.l...@gmail.com>
wrote:

> Hello grpcs,
>
> I have the following task sent from client to server.
>
> service applis {
>   rpc GenerateVoxelMesh(VoxelMeshRequest) returns (VoxelMeshReply) {}
> }
>
> message VoxelMeshRequest {
>   any image_input = 1;
>   bool smooth = 4;
>   int32 iterations = 5;
>   double mu = 6;
>   double lambda = 7;
>   double scale = 8;
>   repeat int32 part_ids = 9;
> }
>
> message VoxelMeshReply {
>   any nas_output = 1; // text file
> }
>
> The image_input, nas_output are the binary files that can be fairly large
> sometimes. I would guess the `any` is not a recommended type.
> It is preferred to use stream chunk bytes to send and receive the image
> and nas files. However, if we stream chunk file, we can not send
> the other request parameters at one call. We will have to make multiple
> calls and make server side a state machine. It increases the complexity.
>
> I am just wondering if there any more element design or what the idiomatic
> way of doing this in grpc?
>
> the possible design like below.
>
> service applis {
>   rpc GenerateVoxelMesh(stream VoxelMeshRequest) returns (stream
> VoxelMeshReply) {}
> }
>
> message VoxelMeshRequest {
>     oneof test_oneof {
>        FileChunk image_input = 1;
>        VoxelMeshParamters mesh_params = 2;
>     }
> }
>
> message FileChunk {
>  bytes chunk = 1;
> }
>
> message VoxelMeshParameters {
>   bool smooth = 4;
>   int32 iterations = 5;
>   double mu = 6;
>   double lambda = 7;
>   double scale = 8;
>   repeat int32 part_ids = 9;
> }
>
> message VoxelMeshReply {
>   FileChunk nas_output = 1; // text file
> }
>
> Any suggestion will be appreciated.
> Thanks in advance,
> Weidong
>
> --
> You received this message because you are subscribed to the Google Groups "
> grpc.io" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to grpc-io+unsubscr...@googlegroups.com.
> To post to this group, send email to grpc-io@googlegroups.com.
> Visit this group at https://groups.google.com/group/grpc-io.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/grpc-io/05b404bb-b7a4-4f93-9e21-ea301da5b4d2%40googlegroups.com
> <https://groups.google.com/d/msgid/grpc-io/05b404bb-b7a4-4f93-9e21-ea301da5b4d2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Rudi Chiarito — Infrastructure — Clarifai, Inc.
"Trust me, I know what I'm doing." (Sledge Hammer!)

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to grpc-io+unsubscr...@googlegroups.com.
To post to this group, send email to grpc-io@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAPzY34_MBSb0vx%2BksfcgF8y9dSyhdi6HJ9ounHHrXiFtPXZ9yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to