Add a new SDL storage API function 'is_active()'
[ric-plt/sdlpy.git] / ricsdl-package / examples / sync.py
index f01369a..6ea9ef9 100644 (file)
@@ -78,6 +78,11 @@ mysdl = _try_func_return(SyncStorage)
 # database services.
 # mysdl = _try_func_return(lambda: SyncStorage(fake_db_backend='dict'))
 
+# Checks if SDL is operational. Note that it is not necessary to call `is_active()` after each
+# SDL instance creation. Below example is here just to show how to call it spontaneously
+# when SDL healthiness is needed to check.
+is_active = mysdl.is_active()
+assert is_active is True
 
 # Sets a value 'my_value' for a key 'my_key' under given namespace. Note that value
 # type must be bytes and multiple key values can be set in one set function call.