pubsub: Mark return values as [[nodiscard]]

Since PubSub's Subscribe and Publish methods are fallible, callers need
to inspect the return values and act accordingly. This CL marks those
methods as [[nodiscard]], and updates the callsites to abort, retry, or
ignore on failure. It also adds PublishBlocking, which will wait for the
event queue lock to become available and only fail when the queue is
full.

Change-Id: I931af92105145346274b364c0ec06d7b52710d3a
Reviewed-on: https://pigweed-internal-review.git.corp.google.com/c/pigweed/showcase/rp2/+/73949
Pigweed-Auto-Submit: Aaron Green <aarongreen@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pw-internal-service-accounts.iam.gserviceaccount.com>
13 files changed
tree: 3f91c218c49fb3c2a5dcfe029f3aa2fecedbe133
  1. .github/
  2. .vscode/
  3. apps/
  4. device/
  5. modules/
  6. system/
  7. targets/
  8. tools/
  9. web_app/
  10. .bazelignore
  11. .bazelrc
  12. .bazelversion
  13. .buildifier.json
  14. .clang-format
  15. .clangd.shared
  16. .gitignore
  17. .pw_console.yaml
  18. AUTHORS
  19. BUILD.bazel
  20. CONTRIBUTING.md
  21. LICENSE
  22. MODULE.bazel
  23. OWNERS
  24. pigweed.json
  25. README.md
README.md

Pigweed Open Source Template Repository

This repository is a template that we will use when creating new open source repositories for Pigweed.