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

Simplify NATS signaling #55

Closed
wants to merge 1 commit into from
Closed

Simplify NATS signaling #55

wants to merge 1 commit into from

Conversation

tdgroot
Copy link
Contributor

@tdgroot tdgroot commented Dec 12, 2023

Now it only sends events from a separate async thread and makes use of nats.py.

Now it only sends events from a separate async thread and makes use of nats.py.
@@ -6,4 +6,4 @@ pytest-xdist==3.2.0
tox==4.4.5
black==23.1.0
pre-commit==2.21.0
-e git+https://github.com/ByteInternet/nats-python.git@755ce98487ad15bec2889365d8b7caa4b2455e84#egg=nats-python
nats-py==2.6.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
nats-py==2.6.0
git+https://github.com/ByteInternet/nats.py@20230810-hypernode

target=watch_for_changes,
args=(nginx_config_changed_handler, nats_server),
)
nats_thread.start()
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see this thread being closed anywhere. What if the process is killed, do we have lingering threads?

@@ -400,7 +374,11 @@ def process_IN_DELETE(self, event):
)

if nats_server:
start_message_subscribe_loop(nginx_config_changed_handler, nats_server)
nats_thread = threading.Thread(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work with async? Shouldn't you use asyncio.get_running_loop() instead?

@tdgroot tdgroot closed this Jan 9, 2024
@AlexanderGrooff AlexanderGrooff deleted the async_nats branch January 15, 2024 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants