-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Pub/sub #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sigurdm
wants to merge
20
commits into
googleapis:main
Choose a base branch
from
sigurdm:pub_sub
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: Pub/sub #244
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
77d01f4
Implement google_cloud_pubsub package with gRPC and resolve protobuf …
sigurdm 4be47d9
Use grpc
sigurdm aa7c181
lints
sigurdm eda1eaa
update deps diagram
sigurdm bd77866
Update pkgs/google_cloud_pubsub/lib/src/client.dart
sigurdm 75b1543
work
sigurdm 89030f6
PubSub: Remove web support, add common exception, improve tests, and …
sigurdm f5cb39d
PubSub: Commit forgotten files (example and credentials helper) and s…
sigurdm 5640799
Fix credentials helper race condition, HTTP client leak, and flaky pu…
sigurdm b5bdc72
Merge branch 'origin/main' into pub_sub
sigurdm ed9b387
Regenerate workspace dependency diagram and update docs to include go…
sigurdm c34002d
feat(pubsub): add handwritten client code
sigurdm e52b4eb
refactor(pubsub): hide ReceivedMessage constructor from public API
sigurdm bc36dd7
refactor(pubsub): make ReceivedMessage a pure data class
sigurdm 1468628
docs(pubsub): document project ID fallback for emulator
sigurdm f407966
Merge origin/pub_sub (old history) into clean pub_sub using ours stra…
sigurdm fe7ba0b
chore(pubsub): add missing copyright headers to existing files
sigurdm f2b99f4
refactor(pubsub): align acknowledge and modifyAckDeadline signatures …
sigurdm d4cf8f8
fix(pubsub): address review comments on PR 244
sigurdm b665761
Address review comments on PR #244
sigurdm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| // Copyright 2026 Google LLC | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // https://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import 'dart:async'; | ||
|
|
||
| import 'package:google_cloud_pubsub/google_cloud_pubsub.dart'; | ||
|
|
||
| /// An example demonstrating how to initialize and use the [PubSub] client | ||
| /// with Google Application Default Credentials (ADC) authentication. | ||
| Future<void> main() async { | ||
| // Asynchronously construct the ADC authenticator with the required Pub/Sub scope. | ||
| final authenticator = await applicationDefaultCredentialsAuthenticator([ | ||
| 'https://www.googleapis.com/auth/pubsub', | ||
| ]); | ||
|
|
||
| // Pass the authenticator to the PubSub client constructor. | ||
| final pubsub = PubSub( | ||
| projectId: 'my-project-id', | ||
| authenticator: authenticator, | ||
| ); | ||
|
|
||
| try { | ||
| // The client will use the authenticator to make authenticated requests. | ||
| final topic = pubsub.topic('my-topic'); | ||
| print('Successfully initialized client for topic: ${topic.id}'); | ||
| } finally { | ||
| await pubsub.close(); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.