Skip to content

Commit c4257df

Browse files
committed
Simplify example
1 parent 466b398 commit c4257df

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

misc/atexit-example.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
# in the async background thread with blocking async queue reads, eliminating
2020
# the blocking queue write operations, and allowing the client to continue running
2121
# in atexit threads
22-
def access_default_client(client: lms.Client):
22+
@atexit.register
23+
def access_default_client():
2324
"""Ensure default client can be accessed from an atexit hook."""
2425
print("During shutdown:", end=" ", flush=True)
25-
print(client.list_loaded_models())
26-
27-
atexit.register(access_default_client, lms.get_default_client())
26+
print(lms.list_loaded_models())
2827

2928
print("Prior to shutdown:", lms.list_loaded_models())

0 commit comments

Comments
 (0)