pw_rpc: Python client improvements

- Use the Call object directly as the context object. This is simpler
  and makes cancelling prior calls easier.
- Return the previous context when a duplicate RPC is called.
- Cancel the prior RPC call when the same RPC is called again on the
  same channel.
- Update the response iteration API.
  - Don't use "block" since it is redundant with timeout_s=0.
  - Accept optional "count" arg for how many responses to receive.
  - Don't cancel the RPC if iteration fails. If there is a server error,
    the RPC will be terminated anyway. The user may cancel directly on
    the call object or by using it in a with block.
  - Remove accidental get_responses on client streaming RPCs.
- Propagate exceptions from user callbacks so they aren't just logged.
- Add unit and integration tests.

Change-Id: I01a322b067f1b01ac0443024b9f7bdc345309a47
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56553
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com>
6 files changed
tree: 768f103cc02abef42e8cf94341a8c45aaffbe724
  1. build_overrides/
  2. docker/
  3. docs/
  4. pw_allocator/
  5. pw_analog/
  6. pw_android_toolchain/
  7. pw_arduino_build/
  8. pw_assert/
  9. pw_assert_basic/
  10. pw_assert_log/
  11. pw_base64/
  12. pw_bloat/
  13. pw_blob_store/
  14. pw_boot/
  15. pw_boot_cortex_m/
  16. pw_build/
  17. pw_build_info/
  18. pw_bytes/
  19. pw_checksum/
  20. pw_chrono/
  21. pw_chrono_embos/
  22. pw_chrono_freertos/
  23. pw_chrono_stl/
  24. pw_chrono_threadx/
  25. pw_cli/
  26. pw_console/
  27. pw_containers/
  28. pw_cpu_exception/
  29. pw_cpu_exception_cortex_m/
  30. pw_crypto/
  31. pw_docgen/
  32. pw_doctor/
  33. pw_env_setup/
  34. pw_function/
  35. pw_fuzzer/
  36. pw_hdlc/
  37. pw_hex_dump/
  38. pw_i2c/
  39. pw_interrupt/
  40. pw_interrupt_cortex_m/
  41. pw_kvs/
  42. pw_libc/
  43. pw_log/
  44. pw_log_basic/
  45. pw_log_null/
  46. pw_log_rpc/
  47. pw_log_tokenized/
  48. pw_malloc/
  49. pw_malloc_freelist/
  50. pw_metric/
  51. pw_minimal_cpp_stdlib/
  52. pw_module/
  53. pw_multisink/
  54. pw_package/
  55. pw_persistent_ram/
  56. pw_polyfill/
  57. pw_preprocessor/
  58. pw_presubmit/
  59. pw_protobuf/
  60. pw_protobuf_compiler/
  61. pw_random/
  62. pw_result/
  63. pw_ring_buffer/
  64. pw_router/
  65. pw_rpc/
  66. pw_snapshot/
  67. pw_span/
  68. pw_status/
  69. pw_stm32cube_build/
  70. pw_stream/
  71. pw_string/
  72. pw_symbolizer/
  73. pw_sync/
  74. pw_sync_baremetal/
  75. pw_sync_embos/
  76. pw_sync_freertos/
  77. pw_sync_stl/
  78. pw_sync_threadx/
  79. pw_sys_io/
  80. pw_sys_io_arduino/
  81. pw_sys_io_baremetal_lm3s6965evb/
  82. pw_sys_io_baremetal_stm32f429/
  83. pw_sys_io_stdio/
  84. pw_target_runner/
  85. pw_thread/
  86. pw_thread_embos/
  87. pw_thread_freertos/
  88. pw_thread_stl/
  89. pw_thread_threadx/
  90. pw_tls_client/
  91. pw_tls_client_boringssl/
  92. pw_tls_client_mbedtls/
  93. pw_tokenizer/
  94. pw_tool/
  95. pw_toolchain/
  96. pw_trace/
  97. pw_trace_tokenized/
  98. pw_transfer/
  99. pw_unit_test/
  100. pw_varint/
  101. pw_watch/
  102. pw_web_ui/
  103. pw_work_queue/
  104. targets/
  105. third_party/
  106. .bazelignore
  107. .bazelrc
  108. .clang-format
  109. .clang-tidy
  110. .eslintrc.json
  111. .gitattributes
  112. .gitignore
  113. .gn
  114. .prettierrc.js
  115. .pylintrc
  116. activate.bat
  117. AUTHORS
  118. bootstrap.bat
  119. bootstrap.sh
  120. BUILD.bazel
  121. BUILD.gn
  122. BUILDCONFIG.gn
  123. CMakeLists.txt
  124. LICENSE
  125. modules.gni
  126. OWNERS
  127. package.json
  128. PW_PLUGINS
  129. README.md
  130. tsconfig.json
  131. WORKSPACE
  132. yarn.lock
README.md

See our website: http://pigweed.dev