Skip to content

feat(pubsub): implement into_stream for a Session#4590

Open
haphungw wants to merge 7 commits intogoogleapis:mainfrom
haphungw:session-futures-stream
Open

feat(pubsub): implement into_stream for a Session#4590
haphungw wants to merge 7 commits intogoogleapis:mainfrom
haphungw:session-futures-stream

Conversation

@haphungw
Copy link
Contributor

@haphungw haphungw commented Feb 6, 2026

Allow Session to be used as a futures::Stream. This enables the use of streaming primitives for message processing.
This feature is gated behind unstable-stream to maintain API stability.

Fixes #4574

@product-auto-label product-auto-label bot added the api: pubsub Issues related to the Pub/Sub API. label Feb 6, 2026
@codecov
Copy link

codecov bot commented Feb 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.01%. Comparing base (4662c64) to head (c1e4461).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4590   +/-   ##
=======================================
  Coverage   95.01%   95.01%           
=======================================
  Files         195      195           
  Lines        7458     7464    +6     
=======================================
+ Hits         7086     7092    +6     
  Misses        372      372           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haphungw haphungw force-pushed the session-futures-stream branch from b793089 to 5af3de9 Compare February 6, 2026 19:19
@haphungw haphungw changed the title feat(pubsub): implement into_stream for a Session feat(pubsub): implement into_stream for a Session Feb 6, 2026
@haphungw haphungw marked this pull request as ready for review February 6, 2026 19:38
@haphungw haphungw requested a review from a team as a code owner February 6, 2026 19:38
Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code all looks good.

  • we definitely need to exercise the new feature in our CI
  • we should document the new feature
  • the tests could be cleaned up a bit

@haphungw haphungw force-pushed the session-futures-stream branch from 5af3de9 to c46d369 Compare February 6, 2026 21:37
@haphungw haphungw force-pushed the session-futures-stream branch from c46d369 to c1e4461 Compare February 6, 2026 22:17
Copy link
Member

@dbolduc dbolduc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the docs thing, then I think we are good to go

//! [gcloud-pubsub]: https://crates.io/crates/gcloud-pubsub
//! [ring]: https://crates.io/crates/ring

#[cfg_attr(docsrs, feature(doc_cfg))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works?? I think it should be:

Suggested change
#[cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, feature(doc_cfg))]

basically #[...] applies to the thing immediately below it, but #![...] applies to the module in scope, which in lib.rs, is the whole crate.

Copy link
Member

@dbolduc dbolduc Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh lol, we only try to build 20 crates on PRs (probably for timing reasons). I guess pubsub is not one of them.

packages=("${all_packages[@]:0:20}")
if [[ "${TRIGGER_NAME:-}" == "gcb-pm-*" ]]; then
packages=("${all_packages[@]}")
fi

I think the post-merge build would fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session should be usable as a futures::Stream

2 participants