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

Add document listener #329

Merged
merged 8 commits into from
Nov 10, 2023
Merged

Add document listener #329

merged 8 commits into from
Nov 10, 2023

Conversation

callumforrester
Copy link
Collaborator

Chagnes:

  • Add CLI command to listen for documents from the message bus and print them to the console

print(f"Subscribing to all bluesky events from {config.stomp.host}:{config.stomp.port}")
with amq_client:
amq_client.subscribe_to_all_events(on_event)
input()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it worth adding a message along the lines of 'Press enter to exit'?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Wonderfully paradoxical sentence but yes

Copy link
Contributor

@tpoliaw tpoliaw 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 other than the lint complaints

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #329 (9d2bf10) into main (7994906) will decrease coverage by 0.50%.
The diff coverage is 47.36%.

@@            Coverage Diff             @@
##             main     #329      +/-   ##
==========================================
- Coverage   87.06%   86.57%   -0.50%     
==========================================
  Files          41       41              
  Lines        1531     1549      +18     
==========================================
+ Hits         1333     1341       +8     
- Misses        198      208      +10     
Files Coverage Δ
src/blueapi/cli/amq.py 54.76% <66.66%> (+0.91%) ⬆️
src/blueapi/cli/cli.py 70.05% <43.75%> (-2.97%) ⬇️

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

Comment on lines 79 to 80
resources:
{{- toYaml .Values.resources | nindent 12 }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resources should be much smaller than the resources for the blueapi main container

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll just remove the resource requirements entirely and let k8s work it out. Do you think that's reasonable?

The alternative is including a listener.resources section in the values.yaml which I don't know if we should do since it's such a small process

@rosesyrett
Copy link
Contributor

I don't particularly care that codecov is failing. Writing an integration test for this sort of thing is hard, because we need a test that simultaneously; 1. puts things on the message bus and 2.listens to it. This can be a ticket for later, but for now I'm happy to merge this.

@rosesyrett rosesyrett merged commit 8151ca1 into main Nov 10, 2023
22 of 23 checks passed
@rosesyrett rosesyrett deleted the doc-listener branch November 10, 2023 09:35
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