Skip to content

Commit

Permalink
[eclipse-kanto#98] Ensure graceful exit of the quickstart Python scri…
Browse files Browse the repository at this point in the history
…pt and the How-to guide Python scripts

Fixed hono_commands_su.py

Signed-off-by: Daniel Milchev <[email protected]>
  • Loading branch information
daniel-milchev committed Aug 31, 2022
1 parent 776795a commit 2d00e2e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions quickstart/hono_commands_su.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ def on_message(self, event):
print('[ok]', "su")
else:
print('[error]')
event.receiver.close()
event.connection.close()

def on_connection_closed(self, event):
print('[closing]')
os.kill(os.getpid(), signal.SIGINT)



class CommandsInvoker(MessagingHandler):
def __init__(self, server, address):
super(CommandsInvoker, self).__init__()
Expand Down

0 comments on commit 2d00e2e

Please sign in to comment.