We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 466b398 commit c4257dfCopy full SHA for c4257df
misc/atexit-example.py
@@ -19,11 +19,10 @@
19
# in the async background thread with blocking async queue reads, eliminating
20
# the blocking queue write operations, and allowing the client to continue running
21
# in atexit threads
22
-def access_default_client(client: lms.Client):
+@atexit.register
23
+def access_default_client():
24
"""Ensure default client can be accessed from an atexit hook."""
25
print("During shutdown:", end=" ", flush=True)
- print(client.list_loaded_models())
26
-
27
-atexit.register(access_default_client, lms.get_default_client())
+ print(lms.list_loaded_models())
28
29
print("Prior to shutdown:", lms.list_loaded_models())
0 commit comments