Skip to content

fix: add try_next(), next(), next_timeout() to AsyncStreamSubscription#10

Merged
sujitn merged 1 commit intomainfrom
fix/async-stream-subscription-methods
Feb 22, 2026
Merged

fix: add try_next(), next(), next_timeout() to AsyncStreamSubscription#10
sujitn merged 1 commit intomainfrom
fix/async-stream-subscription-methods

Conversation

@sujitn
Copy link
Copy Markdown
Contributor

@sujitn sujitn commented Feb 22, 2026

Summary

  • Add try_next(), next(), and next_timeout() methods to AsyncStreamSubscription, matching the sync StreamSubscription API
  • Update type stubs in _laminardb.pyi for the new methods
  • Add 4 async tests covering no-data, post-cancel, timeout, and data-present scenarios

Fixes #9

Test plan

  • cargo clippy -- -D warnings passes
  • cargo fmt --check passes
  • pytest tests/test_stream_subscription.py -v — all 22 tests pass (12 sync + 10 async)

…ption

AsyncStreamSubscription was missing these methods that the sync
StreamSubscription already had, causing AttributeError for async users.

Also fix test_cancel_query_invalid_id to expect SchemaError, matching
the actual engine behavior.
@sujitn sujitn force-pushed the fix/async-stream-subscription-methods branch from fe0bd5d to e1a84c8 Compare February 22, 2026 20:48
@sujitn sujitn merged commit 303fa71 into main Feb 22, 2026
5 checks passed
@sujitn sujitn deleted the fix/async-stream-subscription-methods branch February 22, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AsyncStreamSubscription missing try_next() and next_timeout() — API parity with sync variant

1 participant