Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
LOOP THREAD
# Run the MQTT loop for the subscriber in a separate thread
subscriber_thread = threading.Thread(target=subscriber_client.loop_forever)
subscriber_thread.start()

# Run the publisher functions in separate threads
energy_thread = threading.Thread(target=publish_energy_data, args=(publisher_client,))
temperature_thread = threading.Thread(target=publish_temperature_data, args=(publisher_client,))

energy_thread.start()
temperature_thread.start()

# Wait for the threads to complete
energy_thread.join()
temperature_thread.join()
  • Loading branch information
kaurm105 committed Jul 31, 2024
1 parent 4cfaaab commit ddd162c
Showing 1 changed file with 0 additions and 0 deletions.
Binary file added Screenshot 2024-07-31 203035.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ddd162c

Please sign in to comment.