Skip to content
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

feat: pubsub mvp #347

Merged
merged 19 commits into from
Mar 16, 2023
Merged

feat: pubsub mvp #347

merged 19 commits into from
Mar 16, 2023

Conversation

malandis
Copy link
Contributor

@malandis malandis commented Mar 15, 2023

  • Adds a top level TopicClient for publishing and subscribing to topics
  • Adds an internal PubsubClient for abstracting calls to the pubsub service
  • Adds an example driver examples/topic-publish.ts and examples/topic-subscribe.ts

To run the example:

cd examples
npm run topic-subscribe cacheName topicName

# in another terminal
npm run topic-publish cacheName topicName message

For example:

npm run topic-subscribe my-cache dogs

# in another terminal
npm run topic-publish my-cache dogs poodle
npm run topic-publish my-cache dogs corgi

Implement a new top-level client for interacting with
topics. Implement internal pubsub client for interacting with the
pubsub service.
src/topic-client.ts Outdated Show resolved Hide resolved
@malandis
Copy link
Contributor Author

In the current form, the end-user has no way to close a subscription stream.

Copy link
Contributor

@cprice404 cprice404 left a comment

Choose a reason for hiding this comment

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

this is looking great to me. Let's get @allenheltondev to weigh in on the example syntax / callback naming. Then just a few nits to clean up and we can merge this and deal with the rest in follow-ups.

examples/topic-subscribe.ts Outdated Show resolved Hide resolved
examples/topic-subscribe.ts Outdated Show resolved Hide resolved
examples/topic-subscribe.ts Outdated Show resolved Hide resolved
src/internal/pubsub-client.ts Show resolved Hide resolved
src/internal/pubsub-client.ts Outdated Show resolved Hide resolved
src/topic-client.ts Outdated Show resolved Hide resolved
examples/topic-subscribe.ts Outdated Show resolved Hide resolved
src/internal/pubsub-client.ts Outdated Show resolved Hide resolved
src/internal/pubsub-client.ts Show resolved Hide resolved
Copy link
Contributor

@cprice404 cprice404 left a comment

Choose a reason for hiding this comment

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

you need to split the examples out to a separate PR and revert the .. in the examples package.json but other than that I'm good to go on this

@malandis malandis requested a review from allenheltondev March 16, 2023 22:00
Copy link

@allenheltondev allenheltondev left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you for updating the function names to onItem and onError!

@malandis malandis marked this pull request as ready for review March 16, 2023 22:25
@malandis malandis merged commit 8627584 into main Mar 16, 2023
@malandis malandis deleted the feat/pubsub-mvp branch March 16, 2023 22:29
@malandis malandis mentioned this pull request Mar 16, 2023
5 tasks
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.

3 participants