389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
|
# File 'src/ruby/pb/test/client.rb', line 389
def client_compressed_streaming
first_request = StreamingInputCallRequest.new(
payload: Payload.new(type: :COMPRESSABLE, body: nulls(27_182)),
expect_compressed: BoolValue.new(value: true)
)
send_probe_for_compressed_request_support do
request_uncompressed_args = {
COMPRESSION_REQUEST_ALGORITHM => 'identity'
}
@stub.streaming_input_call([first_request],
metadata: request_uncompressed_args)
end
second_request = StreamingInputCallRequest.new(
payload: Payload.new(type: :COMPRESSABLE, body: nulls(45_904)),
expect_compressed: BoolValue.new(value: false)
)
requests = WriteFlagSettingStreamingInputEnumerable.new([
{ request: first_request,
write_flag: 0 },
{ request: second_request,
write_flag: GRPC::Core::WriteFlags::NO_COMPRESS }
])
call_op = @stub.streaming_input_call(requests,
return_op: true)
requests.call_op = call_op
resp = call_op.execute
wanted_aggregate_size = 73_086
assert("#{__callee__}: aggregate payload size is incorrect") do
wanted_aggregate_size == resp.aggregated_payload_size
end
end
|